Skip to content

Commit 8701204

Browse files
RunCor399Manuel Enrique Colotti
andauthored
fix: Create private_ipv6_egress routes only when having at least one private subnet (#1062)
Co-authored-by: Manuel Enrique Colotti <[email protected]>
1 parent c182453 commit 8701204

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1021,7 +1021,7 @@ resource "aws_egress_only_internet_gateway" "this" {
10211021
}
10221022

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

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

0 commit comments

Comments
 (0)