Files
floci/src/main/java
Matheus Oliveira 8298779ead fix(cloudformation): replace AWS::S3::Bucket when BucketName changes (#5762)
A change to BucketName is a replacement: CloudFormation creates the new
bucket first and then deletes the old one, unless UpdateReplacePolicy is
Retain. S3CfnProvisioner created the replacement but never removed the
displaced bucket, so a successful rename left both buckets, and a rename
that a later resource failed ended in UPDATE_ROLLBACK_FAILED, with
DescribeStackResources still naming the new bucket.

Record the displaced bucket with ReplacementCleanup and delegate the
replacement lifecycle to it, so the committed update deletes the old
bucket, honouring UpdateReplacePolicy: Retain, and a rollback points the
resource back at the original bucket and deletes the replacement. Route
the bucket delete through CfnDeletes.safeDelete so a bucket already gone
is tolerated while a real failure such as BucketNotEmpty still propagates
and reaches the stack as DELETE_FAILED.

Fixes #5678

Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
2026-10-18 10:52:00 -04:00
..