Skip to content

Commit 891ba1a

Browse files
committed
enable nat gateway when only private subnets are enabled
1 parent 6793ec5 commit 891ba1a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

nat-gateway.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ resource "aws_nat_gateway" "default" {
1111
count = local.nat_gateway_enabled ? local.nat_count : 0
1212

1313
allocation_id = local.nat_eip_allocations[count.index]
14-
subnet_id = aws_subnet.public[count.index].id
14+
subnet_id = local.public_enabled ? aws_subnet.public[count.index].id : aws_subnet.private[count.index].id
1515

1616
tags = merge(
1717
module.nat_label.tags,

0 commit comments

Comments
 (0)