Skip to content

feat(cloudformation-stack): add ForceDeleteStack setting - #2

Merged
chadwpetersen merged 2 commits into
mainfrom
instruqt/cfn-force-delete-stack
Jun 25, 2026
Merged

feat(cloudformation-stack): add ForceDeleteStack setting#2
chadwpetersen merged 2 commits into
mainfrom
instruqt/cfn-force-delete-stack

Conversation

@chadwpetersen

Copy link
Copy Markdown

Fork-side review for the upstream PR ekristen#985.

Adds a new opt-in ForceDeleteStack setting that passes DeletionMode=FORCE_DELETE_STACK to DeleteStack. CloudFormation drops the stack record even when resources fail to delete, leaving orphans rather than the stack stuck in DELETE_FAILED.

Useful for tear-down scenarios where the goal is to release the stack, not preserve its resources — sandbox/CI account cleanup is the common case.

Default behavior is unchanged. Existing CreateRoleToDeleteStack and UseCurrentRoleToDeleteStack flows are untouched.

CloudFormation's DeleteStack API supports DeletionMode=FORCE_DELETE_STACK,
which drops the stack record even when individual resources fail to
delete. The stack's orphaned resources remain in the account, but the
stack itself is gone and won't keep retrying.

Useful for tear-down scenarios (e.g. sandbox cleanup) where the goal is
to release the stack rather than preserve its resources, and where any
orphans will be cleaned up by subsequent passes.

Opt-in via the new Settings flag; default behavior is unchanged.
@chadwpetersen
chadwpetersen merged commit 2c5d239 into main Jun 25, 2026
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