Skip to content

Commit

Permalink
Fix: public route table 생성 조건
Browse files Browse the repository at this point in the history
  • Loading branch information
timepresent95 committed Dec 6, 2024
1 parent 124b17a commit d3642df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ resource "aws_route_table_association" "public_route_table_association" {
for_each = aws_subnet.public

subnet_id = each.value.id
route_table_id = aws_route_table.public.id
route_table_id = aws_route_table[0].public.id
}

resource "aws_route" "public_internet_gateway" {
count = length(aws_subnet.public) == 0 ? 0 : 1

route_table_id = aws_route_table.public.id
route_table_id = aws_route_table[0].public.id
destination_cidr_block = "0.0.0.0/0"
gateway_id = aws_internet_gateway.ig.id
gateway_id = aws_internet_gateway[0].ig.id
}

/*
Expand Down

0 comments on commit d3642df

Please sign in to comment.