@@ -120,7 +120,7 @@ resource "aws_route_table" "quortex_private" {
120
120
121
121
# Route to the NAT, if NAT is enabled...
122
122
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 ] : []
124
124
iterator = nat_route
125
125
126
126
content {
@@ -131,7 +131,7 @@ resource "aws_route_table" "quortex_private" {
131
131
132
132
# ...otherwise, route to the Internet Gateway
133
133
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 ]
135
135
iterator = igw_route
136
136
137
137
content {
@@ -140,6 +140,26 @@ resource "aws_route_table" "quortex_private" {
140
140
}
141
141
}
142
142
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
+
143
163
tags = merge ({ " Name" = " ${ var . route_table_prefix } ${ each . key } " }, var. tags )
144
164
}
145
165
0 commit comments