Skip to content

fix: skip DeletionPolicy removal for non-updatable stack statuses#607

Merged
go-to-k merged 2 commits intomainfrom
feat/skip-update-non-updatable-stack-status
Mar 24, 2026
Merged

fix: skip DeletionPolicy removal for non-updatable stack statuses#607
go-to-k merged 2 commits intomainfrom
feat/skip-update-non-updatable-stack-status

Conversation

@go-to-k
Copy link
Copy Markdown
Owner

@go-to-k go-to-k commented Mar 24, 2026

Summary

  • Change RemoveDeletionPolicy to only execute UpdateStack for stacks in updatable statuses using a positive list approach
  • Fix error when using -f option on stacks in non-updatable states such as DELETE_FAILED
  • Log a warning when skipping, so users are aware that resources with Retain DeletionPolicy may not be cleaned up

Background

When trying to delete a stack in DELETE_FAILED state with delstack -f, the UpdateStack API returned a ValidationError and failed.

Previously, only ROLLBACK_COMPLETE was skipped, but since UpdateStack is only allowed for a limited set of statuses, we now define updatable statuses (CREATE_COMPLETE, UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, IMPORT_COMPLETE, IMPORT_ROLLBACK_COMPLETE) as a positive list.

Previously, RemoveDeletionPolicy only skipped ROLLBACK_COMPLETE stacks.
Stacks in other non-updatable states (e.g. DELETE_FAILED, ROLLBACK_FAILED)
would fail with an UpdateStack API error.

Use a positive list of updatable statuses instead, and log a warning when
skipping so users are aware that Retain resources may not be cleaned up.
@go-to-k go-to-k merged commit a29bdf2 into main Mar 24, 2026
2 checks passed
@go-to-k go-to-k deleted the feat/skip-update-non-updatable-stack-status branch March 24, 2026 09:45
This was referenced Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant