From cf18c37591f860908e2223b4f488787e8a5f74f3 Mon Sep 17 00:00:00 2001 From: Manuel Mazzuola <1757492+manuelmazzuola@users.noreply.github.com> Date: Fri, 26 Apr 2024 17:20:33 +0200 Subject: [PATCH] fix: Do not replace NAT gateways when additional subnets are added (#1055) fix: Do not replace nat gateways when new private subnets are added --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 2c1e97f39..32239e588 100644 --- a/main.tf +++ b/main.tf @@ -1052,7 +1052,7 @@ resource "aws_route" "private_ipv6_egress" { locals { nat_gateway_count = var.single_nat_gateway ? 1 : var.one_nat_gateway_per_az ? length(var.azs) : local.max_subnet_length - nat_gateway_ips = var.reuse_nat_ips ? var.external_nat_ip_ids : try(aws_eip.nat[*].id, []) + nat_gateway_ips = var.reuse_nat_ips ? var.external_nat_ip_ids : aws_eip.nat[*].id } resource "aws_eip" "nat" {