Skip to content

Commit

Permalink
ipv6-private objects created depends on wrong variable (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Ström authored Mar 23, 2022
1 parent 091217b commit 4c600cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ locals {
nat_gateway_count = var.create_nat_gateways ? min(length(local.azs), length(var.public_subnet_cidrs), length(var.private_subnet_cidrs)) : 0

internet_gateway_count = (var.create_internet_gateway && length(var.public_subnet_cidrs) > 0) ? 1 : 0
egress_only_internet_gateway_count = (var.create_egress_only_internet_gateway && length(var.public_subnet_cidrs) > 0) ? 1 : 0
egress_only_internet_gateway_count = (var.create_egress_only_internet_gateway && length(var.private_subnet_cidrs) > 0) ? 1 : 0
}

resource "aws_vpc" "main" {
Expand Down Expand Up @@ -163,7 +163,7 @@ resource "aws_route" "ipv6-private" {
aws_egress_only_internet_gateway.outbound,
aws_route_table.private,
]
count = length(var.public_subnet_cidrs) > 0 ? length(var.private_subnet_cidrs) : 0
count = length(var.private_subnet_cidrs) > 0 ? length(var.private_subnet_cidrs) : 0
route_table_id = aws_route_table.private[count.index].id
egress_only_gateway_id = aws_egress_only_internet_gateway.outbound[0].id
destination_ipv6_cidr_block = "::/0"
Expand Down

0 comments on commit 4c600cc

Please sign in to comment.