From 524ad7dcf931105b95b59456ee9d3ed0ddc3d0a2 Mon Sep 17 00:00:00 2001 From: J Cole Morrison Date: Tue, 14 Apr 2020 13:12:25 -0700 Subject: [PATCH] add eigw to correct table --- vpc.tf | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/vpc.tf b/vpc.tf index e40bf98..51bb6ed 100644 --- a/vpc.tf +++ b/vpc.tf @@ -105,12 +105,6 @@ resource "aws_route" "public_internet_access" { gateway_id = aws_internet_gateway.igw.id } -resource "aws_route" "public_internet_access_ipv6" { - route_table_id = aws_route_table.public.id - destination_ipv6_cidr_block = "::/0" - egress_only_gateway_id = aws_egress_only_internet_gateway.eigw.id -} - ## Private Route Table resource "aws_route_table" "private" { vpc_id = aws_vpc.vault.id @@ -130,6 +124,14 @@ resource "aws_route" "private_internet_access" { nat_gateway_id = aws_nat_gateway.nat[0].id } +resource "aws_route" "private_internet_access_ipv6" { + count = var.operator_mode ? 1 : 0 + + route_table_id = aws_route_table.private.id + destination_ipv6_cidr_block = "::/0" + egress_only_gateway_id = aws_egress_only_internet_gateway.eigw.id +} +