This repository has been archived by the owner on Oct 15, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
AWS recently launched the ability to enable "stop protection" on EC2 instance, similar to the existing "termination protection"
This PR implemented an error-state routine to disable stop protection and retry termination.
Open Question: A new feature flag was added called
DisableEC2InstanceStopProtection
at the top level since this doesn't exactly fit under theDisableDeletionProtection
hierarchy. I'd considered adding this flag under that group and just calling it something likeEC2InstanceStop
to differentiate it, but I felt that might be confusing. Thoughts?I went back and forth on how to handle the retry-routines from two possible error states, but what I came up with works and I tried to document it inline with some comments.
Testing
Create a set of EC2 instances with the following script:
Running AWS Nuke with
EC2Instance
enabled successfully terminates all instances.