From ba7e3d9e9c86af3c0f7089a31a9c98b7c8610837 Mon Sep 17 00:00:00 2001 From: wa101 Date: Sun, 21 Apr 2024 13:59:54 +0200 Subject: [PATCH] enable nat gateway when only private subnets are enabled --- nat-gateway.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nat-gateway.tf b/nat-gateway.tf index 03a95cf..062a975 100644 --- a/nat-gateway.tf +++ b/nat-gateway.tf @@ -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,