Skip to content

Commit 0417b29

Browse files
committed
a
1 parent 7cc91f4 commit 0417b29

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

main.tf

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ resource "aws_route_table" "quortex_private" {
120120

121121
# Route to the NAT, if NAT is enabled...
122122
dynamic "route" {
123-
for_each = lookup(local.zoned_gateway_ids, each.value.availability_zone, null) != null ? [1] : []
123+
for_each = lookup(local.zoned_gateway_ids, each.value.availability_zone, "") != "" ? [1] : []
124124
iterator = nat_route
125125

126126
content {
@@ -131,7 +131,7 @@ resource "aws_route_table" "quortex_private" {
131131

132132
# ...otherwise, route to the Internet Gateway
133133
dynamic "route" {
134-
for_each = lookup(local.zoned_gateway_ids, each.value.availability_zone, null) != null ? [] : [1]
134+
for_each = lookup(local.zoned_gateway_ids, each.value.availability_zone, "") != "" ? [] : [1]
135135
iterator = igw_route
136136

137137
content {
@@ -140,6 +140,26 @@ resource "aws_route_table" "quortex_private" {
140140
}
141141
}
142142

143+
# Additional route(s) to peered VPC
144+
dynamic "route" {
145+
for_each = var.vpc_peering_routes
146+
iterator = peering_route
147+
content {
148+
cidr_block = route.value.cidr_block
149+
vpc_peering_connection_id = route.value.vpc_peering_connection_id
150+
}
151+
}
152+
153+
# Additional route(s) to a VPC internet gateway or a virtual private gateway.
154+
dynamic "route" {
155+
for_each = var.gateway_routes
156+
iterator = gw_route
157+
content {
158+
cidr_block = route.value.cidr_block
159+
gateway_id = route.value.gateway_id
160+
}
161+
}
162+
143163
tags = merge({ "Name" = "${var.route_table_prefix}${each.key}" }, var.tags)
144164
}
145165

0 commit comments

Comments
 (0)