Skip to content

Commit

Permalink
enable nat gateway when only private subnets are enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
wadhah101 committed May 7, 2024
1 parent 6793ec5 commit 891ba1a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nat-gateway.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ resource "aws_nat_gateway" "default" {
count = local.nat_gateway_enabled ? local.nat_count : 0

allocation_id = local.nat_eip_allocations[count.index]
subnet_id = aws_subnet.public[count.index].id
subnet_id = local.public_enabled ? aws_subnet.public[count.index].id : aws_subnet.private[count.index].id

tags = merge(
module.nat_label.tags,
Expand Down

0 comments on commit 891ba1a

Please sign in to comment.