Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add route to 0.0.0.0/0 & ::/0 (when IPv6 is enabled) on all public route tables #1100

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ resource "aws_route_table_association" "public" {
}

resource "aws_route" "public_internet_gateway" {
count = local.create_public_subnets && var.create_igw ? 1 : 0
count = local.create_public_subnets && var.create_igw ? length(aws_route_table.public) : 0
bryantbiggs marked this conversation as resolved.
Show resolved Hide resolved

route_table_id = aws_route_table.public[0].id
route_table_id = aws_route_table.public[count.index].id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.this[0].id

Expand All @@ -164,9 +164,9 @@ resource "aws_route" "public_internet_gateway" {
}

resource "aws_route" "public_internet_gateway_ipv6" {
count = local.create_public_subnets && var.create_igw && var.enable_ipv6 ? 1 : 0
count = local.create_public_subnets && var.create_igw && var.enable_ipv6 ? length(aws_route_table.public) : 0
bryantbiggs marked this conversation as resolved.
Show resolved Hide resolved

route_table_id = aws_route_table.public[0].id
route_table_id = aws_route_table.public[count.index].id
destination_ipv6_cidr_block = "::/0"
gateway_id = aws_internet_gateway.this[0].id
}
Expand Down
Loading