Skip to content

Conversation

@norbert
Copy link
Contributor

@norbert norbert commented Dec 11, 2025

This change makes it possible to allow new NAT instances to launch before terminating old ones by setting the ASG instance maintenance policy.

With allow_launch_before_terminating enabled the routes will only be replaced once (directly from old to new) when instances are refreshed. This behavior is also a prerequisite for syncing conntrack tables as mentioned in #67.

As two instances will briefly run concurrently a spare Elastic IP is needed for the new instance to launch. I refactored the existing Elastic IP calculations, and added a validation for the existing nat_instance_eip_idsvariable in the form of a precondition block. This does require Terraform v1.2 or later, which I think should be fine after more than three years.

Depends on #169.

@norbert norbert changed the title Set ASG instance maintenance policy Allow instance launch before termination Dec 16, 2025
@norbert norbert changed the title Allow instance launch before termination Allow NAT instance launch before termination Dec 16, 2025
@norbert norbert changed the title Allow NAT instance launch before termination Allow NAT instance launch before terminating Dec 16, 2025
@norbert norbert force-pushed the asg-maintenance-policy branch from 0bcf8ec to f503094 Compare December 18, 2025 16:56
@norbert norbert marked this pull request as ready for review December 18, 2025 17:23
@norbert norbert requested review from a team and bwhaley as code owners December 18, 2025 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant