Skip to content

Commit c15259d

Browse files
authored
Merge pull request #171 from pablo19sc/main
Minor fixes - Moving optimized IPv4 subnets examples to Terraform test
2 parents f45df3e + 71191c9 commit c15259d

File tree

5 files changed

+14
-32
lines changed

5 files changed

+14
-32
lines changed

examples/optimized_ipv4_subnets/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This example shows how you can use this module to efficiently use the VPC CIDR r
2323

2424
| Name | Source | Version |
2525
|------|--------|---------|
26-
| <a name="module_vpc"></a> [vpc](#module\_vpc) | aws-ia/vpc/aws | ~> 4.4 |
26+
| <a name="module_vpc"></a> [vpc](#module\_vpc) | ../.. | n/a |
2727

2828
## Resources
2929

@@ -40,7 +40,5 @@ This example shows how you can use this module to efficiently use the VPC CIDR r
4040

4141
## Outputs
4242

43-
| Name | Description |
44-
|------|-------------|
45-
| <a name="output_private_subnets_tags_length"></a> [private\_subnets\_tags\_length](#output\_private\_subnets\_tags\_length) | Count of private subnet tags for a single az. |
43+
No outputs.
4644
<!-- END_TF_DOCS -->

examples/optimized_ipv4_subnets/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ data "aws_availability_zones" "current" {
66
}
77

88
module "vpc" {
9-
source = "aws-ia/vpc/aws"
10-
version = "~> 4.4"
9+
source = "../.."
1110

1211
name = "sorted-subnets"
1312
cidr_block = var.vpc_cidr
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1 @@
1-
## Used for Testing, do not delete
21

3-
output "private_subnets_tags_length" {
4-
description = "Count of private subnet tags for a single az."
5-
value = try(length(module.vpc.private_subnet_attributes_by_az["private/${data.aws_availability_zones.current.names[0]}"].tags), null)
6-
}

test/examples_optimized_ipv4_subnets_test.go

Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
run "validate" {
2+
command = apply
3+
module {
4+
source = "./examples/optimized_ipv4_subnets"
5+
}
6+
7+
assert {
8+
condition = length(module.vpc.private_subnet_attributes_by_az["private/${data.aws_availability_zones.current.names[0]}"].tags) == 1
9+
error_message = "private subnets should have 1 tags total."
10+
}
11+
}

0 commit comments

Comments
 (0)