fix(cloudformation): drop a DynamoDB table's update snapshot once the update commits (#7448)

* fix(cloudformation): drop a DynamoDB table's update snapshot once the update commits

* test(cloudformation): clean up the rollback retry test's stack and table even when it fails, using a shared ContinueUpdateRollback helper
This commit is contained in:
Niels Kootstra authored and GitHub committed 2026-11-04 05:51:43 -04:00
1 parent 1743cb5f75
commit eaefd55980
3 files changed
+94

No files matched your search

@@ -562,6 +562,17 @@ public class DynamoDbCfnProvisioner implements CfnResourceProvisioner {
return resource.getAttributes().containsKey(CfnRollback.DYNAMODB_TABLE_UPDATE_SNAPSHOT_ATTR);
}
/**
* The engine calls this for every resource once a stack update commits. A committed update is
* never rolled back, so its snapshot is dropped here: left on the resource, a retried rollback
* of a later update would put the table back to its state before this one.
*/
@Override
public UpdateCleanupResult completeUpdate(StackResource resource) {
resource.getAttributes().remove(CfnRollback.DYNAMODB_TABLE_UPDATE_SNAPSHOT_ATTR);
return UpdateCleanupResult.notApplicable();
}
/**
* Puts back the tags, stream setting, TTL setting and Kinesis streaming destinations an in-place
* table update changed. All four go back or none is claimed: restoring one alone would report a