Files
floci/src/main/java/io/github/hectorvent
Dixit R Jain 0530ca11ab fix(cloudformation): fail stack delete when a managed resource cannot be deleted (#1554)
DeleteStack swallowed every resource-deletion failure and always reported
DELETE_COMPLETE. Deleting a stack that owned a non-empty AWS::S3::Bucket
therefore "succeeded" while the bucket and its objects were left behind,
which diverges from AWS (S3 refuses to delete a non-empty bucket, so the
stack must end in DELETE_FAILED).

- CloudFormationResourceProvisioner#delete no longer wraps resource deletion
  in a catch-all; failures propagate to the stack-level handler. The lenient
  *Safe helpers and the intentional KMS key no-op are preserved.
- CloudFormationService#deleteStackResources now records per-resource
  failures: the resource is marked DELETE_FAILED with a reason and event,
  remaining resources are still attempted, and the stack settles into
  DELETE_FAILED (retaining the stack and its exports) instead of being
  reported as deleted. Resources left in DELETE_FAILED are re-attempted on a
  subsequent delete, matching AWS retry behavior.

This corrects the same silent-success deviation for every managed resource
type, not just S3 buckets.

Adds a Java integration regression test and AWS CLI compatibility tests
covering both the non-empty (DELETE_FAILED) and empty (DELETE_COMPLETE)
bucket cases.

Fixes #1539
2026-06-25 22:47:19 -05:00
..