Skip to content

Commit 281bf58

Browse files
committed
fix: Update aws_vpn_gateway_route_propagation private/intra count to use route_tables instead of subnets
1 parent 7c1f791 commit 281bf58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,8 +1219,9 @@ resource "aws_vpn_gateway_route_propagation" "public" {
12191219
)
12201220
}
12211221

1222+
# There are as many routing tables as the number of NAT gateways
12221223
resource "aws_vpn_gateway_route_propagation" "private" {
1223-
count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? local.len_private_subnets : 0
1224+
count = local.create_vpc && var.propagate_private_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? local.nat_gateway_count : 0
12241225

12251226
route_table_id = element(aws_route_table.private[*].id, count.index)
12261227
vpn_gateway_id = element(
@@ -1233,7 +1234,7 @@ resource "aws_vpn_gateway_route_propagation" "private" {
12331234
}
12341235

12351236
resource "aws_vpn_gateway_route_propagation" "intra" {
1236-
count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? local.len_intra_subnets : 0
1237+
count = local.create_vpc && var.propagate_intra_route_tables_vgw && (var.enable_vpn_gateway || var.vpn_gateway_id != "") ? local.num_intra_route_tables : 0
12371238

12381239
route_table_id = element(aws_route_table.intra[*].id, count.index)
12391240
vpn_gateway_id = element(

0 commit comments

Comments
 (0)