Skip to content

Commit

Permalink
Do not replace nat gateways when new private subnets are added
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Mazzuola authored and manuelmazzuola committed Mar 21, 2024
1 parent 878b5d2 commit e8bfc7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,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" {
Expand Down

0 comments on commit e8bfc7c

Please sign in to comment.