Commit 8701204c authored by Manuel Enrique Colotti's avatar Manuel Enrique Colotti Committed by GitHub

fix: Create private_ipv6_egress routes only when having at least one private subnet (#1062)

Co-authored-by: default avatarManuel Enrique Colotti <manuel.colotti@agilelab.it>
parent c182453f
......@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment