diff --git a/vpc-transit-gateway-association/self/README.md b/vpc-transit-gateway-association/self/README.md index 6e8cc57..2375cbc 100644 --- a/vpc-transit-gateway-association/self/README.md +++ b/vpc-transit-gateway-association/self/README.md @@ -110,6 +110,8 @@ module "vpc_tgw_self" { | [tags](#input\_tags) | AWS Tags to apply to appropriate resources (S3, KMS). Do not include safeguard tags here, use the data\_safeguard field for such things. | `map(string)` | `{}` | no | | [transit\_gateway\_environment](#input\_transit\_gateway\_environment) | Transit Gateway Environment (aka, VRF) to which to connnect this VPC | `string` | n/a | yes | | [transit\_gateway\_label](#input\_transit\_gateway\_label) | Transit Gateway label for specific instance (sa, prod) | `string` | `"prod"` | no | +| [vpc\_cidr\_block](#input\_vpc\_cidr\_block) | VPC CIDR Block | `string` | `null` | no | +| [vpc\_cidr\_blocks](#input\_vpc\_cidr\_blocks) | VPC CIDR Block List | `list(string)` | `[]` | no | | [vpc\_environment](#input\_vpc\_environment) | VPC environment purpose (infrastructure, common, shared, dev, stage, ite, prod) | `string` | `null` | no | | [vpc\_full\_name](#input\_vpc\_full\_name) | VPC full name component (vpc{index}-{vpc\_name}) | `string` | `null` | no | | [vpc\_id](#input\_vpc\_id) | VPC ID | `string` | n/a | yes | diff --git a/vpc-transit-gateway-association/self/associate.tf b/vpc-transit-gateway-association/self/associate.tf index 7e6dda8..687e78d 100644 --- a/vpc-transit-gateway-association/self/associate.tf +++ b/vpc-transit-gateway-association/self/associate.tf @@ -51,7 +51,7 @@ locals { #--- resource "aws_ec2_transit_gateway_route_table_propagation" "vpc_self_own_rt" { provider = aws.self - for_each = { for k in local.selected_rt : k => local.transit_gateway_route_table_ids_self[k] } + for_each = var.transit_gateway_environment == "services" ? { for k in local.selected_rt : k => local.transit_gateway_route_table_ids_self[k] } : { var.transit_gateway_environment = local.transit_gateway_route_table_ids_self[var.transit_gateway_environment] } transit_gateway_attachment_id = aws_ec2_transit_gateway_vpc_attachment.vpc_attachment.id transit_gateway_route_table_id = each.value