diff --git a/CHANGELOG.md b/CHANGELOG.md index ff6e56e..40c9cb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -451,3 +451,7 @@ * 2.11.4 -- 2025-02-14 - vpc-transit-gateway-association - add inspection as possible tgw_environment + +* 2.11.5 -- 2025-02-18 + - vpc-transit-gateway-association + - allow additional propgate_rt_all options via variable propagate_all_route_table_names diff --git a/common/version.tf b/common/version.tf index 82c12f9..d7643e3 100644 --- a/common/version.tf +++ b/common/version.tf @@ -1,5 +1,5 @@ locals { - _module_version = "2.11.4" + _module_version = "2.11.5" _module_names = { "_main_" = "aws-vpc-setup" diff --git a/vpc-transit-gateway-association/peer/README.md b/vpc-transit-gateway-association/peer/README.md index 5b64375..cdbf49b 100644 --- a/vpc-transit-gateway-association/peer/README.md +++ b/vpc-transit-gateway-association/peer/README.md @@ -235,6 +235,7 @@ No modules. | [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no | | [private\_route\_table\_ids](#input\_private\_route\_table\_ids) | Map of private route table IDs (which exclude the attachment subnets) | `map(string)` | `{}` | no | | [private\_subnets\_ids](#input\_private\_subnets\_ids) | List of private subnet objects including: subnet, label, availability\_zone, id |
list(object({
subnet = string
label = string
availability_zone = string
id = string
}))
| `[]` | no | +| [propagate\_all\_route\_table\_names](#input\_propagate\_all\_route\_table\_names) | List of route table names to propagate routes into for every attachment | `list` |
[
"services",
"inter-region"
]
| no | | [route\_prefix\_list\_name](#input\_route\_prefix\_list\_name) | Shared prefix list name used for routing to TGW. It is comprised of all of the network CIDR blocks in AWS using TGW. | `string` | `"transit-gateway.prod"` | no | | [route\_table\_label](#input\_route\_table\_label) | Route table lable for the attachment subnets | `string` | `"attachment"` | no | | [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 | diff --git a/vpc-transit-gateway-association/peer/associate.tf b/vpc-transit-gateway-association/peer/associate.tf index ee17628..64b3efc 100644 --- a/vpc-transit-gateway-association/peer/associate.tf +++ b/vpc-transit-gateway-association/peer/associate.tf @@ -2,7 +2,8 @@ # get rt variables for use later #--- locals { - propagate_all_rt = ["services", "inter-region"] + # propagate_all_rt = ["services", "inter-region"] + propagate_all_rt = var.propagate_all_route_table_names # selected_rt = [for k in keys(local.transit_gateway_route_table_ids_peer) : k if ! contains(local.propagate_all_rt, k)] selected_rt = [for k in keys(var.data_input.map_route_tables_peer) : k if ! contains(local.propagate_all_rt, k)] } diff --git a/vpc-transit-gateway-association/peer/variables.tf b/vpc-transit-gateway-association/peer/variables.tf index fbd783c..9633402 100644 --- a/vpc-transit-gateway-association/peer/variables.tf +++ b/vpc-transit-gateway-association/peer/variables.tf @@ -57,3 +57,14 @@ variable "private_route_table_ids" { type = map(string) default = {} } + +variable "propagate_all_route_table_names" { + description = "List of route table names to propagate routes into for every attachment" + type = list + default = ["services", "inter-region"] + + validation { + condition = contains(["services", "inter-region", "inspection", "cross-boundary"], var.propagate_all_route_table_names) + error_message = "propagate_all_route_table_names must be one of: services, inter-region, inspection, cross-boundary." + } +} diff --git a/vpc-transit-gateway-association/self/README.md b/vpc-transit-gateway-association/self/README.md index aaad513..6ad6130 100644 --- a/vpc-transit-gateway-association/self/README.md +++ b/vpc-transit-gateway-association/self/README.md @@ -265,6 +265,7 @@ module "vpc_tgw_self" { | [override\_prefixes](#input\_override\_prefixes) | Override built-in prefixes by component. This should be used primarily for common infrastructure things | `map(string)` | `{}` | no | | [private\_route\_table\_ids](#input\_private\_route\_table\_ids) | Map of private route table IDs (which exclude the attachment subnets) | `map(string)` | `{}` | no | | [private\_subnets\_ids](#input\_private\_subnets\_ids) | List of private subnet objects including: subnet, label, availability\_zone, id |
list(object({
subnet = string
label = string
availability_zone = string
id = string
}))
| `[]` | no | +| [propagate\_all\_route\_table\_names](#input\_propagate\_all\_route\_table\_names) | List of route table names to propagate routes into for every attachment | `list` |
[
"services",
"inter-region"
]
| no | | [route\_prefix\_list\_name](#input\_route\_prefix\_list\_name) | Shared prefix list name used for routing to TGW. It is comprised of all of the network CIDR blocks in AWS using TGW. | `string` | `"transit-gateway.prod"` | no | | [route\_table\_label](#input\_route\_table\_label) | Route table lable for the attachment subnets | `string` | `"attachment"` | no | | [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 | diff --git a/vpc-transit-gateway-association/self/associate.tf b/vpc-transit-gateway-association/self/associate.tf index b047032..4aecb82 100644 --- a/vpc-transit-gateway-association/self/associate.tf +++ b/vpc-transit-gateway-association/self/associate.tf @@ -57,7 +57,8 @@ resource "aws_ec2_transit_gateway_route_table_association" "route_table_self" { # get rt variables for use later #--- locals { - propagate_all_rt = ["services", "inter-region"] + # propagate_all_rt = ["services", "inter-region"] + propagate_all_rt = var.propagate_all_route_table_names # selected_rt = [for k in keys(local.transit_gateway_route_table_ids_self) : k if ! contains(local.propagate_all_rt, k)] selected_rt = [for k in keys(var.data_input.map_route_tables_self) : k if ! contains(local.propagate_all_rt, k)] vpn_selected_rt = [for k in keys(var.data_input.map_route_tables_self) : k if ! contains(local.propagate_all_rt, k)] diff --git a/vpc-transit-gateway-association/self/variables.tf b/vpc-transit-gateway-association/self/variables.tf index e84550d..621d10f 100644 --- a/vpc-transit-gateway-association/self/variables.tf +++ b/vpc-transit-gateway-association/self/variables.tf @@ -64,3 +64,13 @@ variable "transit_gateway_environments" { default = [] } +variable "propagate_all_route_table_names" { + description = "List of route table names to propagate routes into for every attachment" + type = list + default = ["services", "inter-region"] + + validation { + condition = contains(["services", "inter-region", "inspection", "cross-boundary"], var.propagate_all_route_table_names) + error_message = "propagate_all_route_table_names must be one of: services, inter-region, inspection, cross-boundary." + } +}