When a CloudFormation stack is deleted, an S3 bucket and DynamoDB table must be kept, and an RDS instance should leave a final snapshot. Which attributes?
Show answer and explanation
Answer: A
DeletionPolicy is applied at stack deletion time: Retain leaves the resource untouched (right for S3 buckets and DynamoDB tables), and Snapshot takes a final snapshot for resources that support it, such as RDS. S3 doesn't support snapshots at all, so Retain is the only fit there.
Why the other options are wrong
- B. A stack policy governs which updates are allowed; stack deletion is a different event.
- C. UpdatePolicy belongs to update behavior (for example Auto Scaling rolling updates), not deletion.
- D. CreationPolicy waits for signals at creation; it plays no role at deletion.