Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
tkerdoncuff committed Feb 6, 2024
1 parent 7cc91f4 commit 0417b29
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ resource "aws_route_table" "quortex_private" {

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

content {
Expand All @@ -131,7 +131,7 @@ resource "aws_route_table" "quortex_private" {

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

content {
Expand All @@ -140,6 +140,26 @@ resource "aws_route_table" "quortex_private" {
}
}

# Additional route(s) to peered VPC
dynamic "route" {
for_each = var.vpc_peering_routes
iterator = peering_route
content {
cidr_block = route.value.cidr_block
vpc_peering_connection_id = route.value.vpc_peering_connection_id
}
}

# Additional route(s) to a VPC internet gateway or a virtual private gateway.
dynamic "route" {
for_each = var.gateway_routes
iterator = gw_route
content {
cidr_block = route.value.cidr_block
gateway_id = route.value.gateway_id
}
}

tags = merge({ "Name" = "${var.route_table_prefix}${each.key}" }, var.tags)
}

Expand Down

0 comments on commit 0417b29

Please sign in to comment.