Skip to content

Commit

Permalink
fix: Create private_ipv6_egress routes only when having at least one …
Browse files Browse the repository at this point in the history
…private subnet (#1062)

Co-authored-by: Manuel Enrique Colotti <manuel.colotti@agilelab.it>
  • Loading branch information
RunCor399 and Manuel Enrique Colotti committed Apr 24, 2024
1 parent c182453 commit 8701204
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,7 @@ resource "aws_egress_only_internet_gateway" "this" {
}

resource "aws_route" "private_ipv6_egress" {
count = local.create_vpc && var.create_egress_only_igw && var.enable_ipv6 ? local.nat_gateway_count : 0
count = local.create_vpc && var.create_egress_only_igw && var.enable_ipv6 && local.len_private_subnets > 0 ? local.nat_gateway_count : 0

route_table_id = element(aws_route_table.private[*].id, count.index)
destination_ipv6_cidr_block = "::/0"
Expand Down

0 comments on commit 8701204

Please sign in to comment.