Testing and Deployment

A CloudFormation-managed database must survive stack deletion or removal from its template. If a property change replaces it, the old database must also remain intact rather than only as a snapshot. Which resource attributes meet these requirements?

Show the answer

Correct answerD. DeletionPolicy: Retain; UpdateReplacePolicy: Retain

AWhy not this: Replacement preserves the old database, but stack deletion or template removal preserves only a snapshot.

BWhy not this: Stack deletion and template removal preserve the database, but replacement preserves only a snapshot of the old database.

CWhy not this: The old database is deleted during replacement despite the DeletionPolicy setting.

DWhy this is right: DeletionPolicy covers deletion and template removal; UpdateReplacePolicy covers the old resource during replacement.

DeletionPolicy: Retain preserves the database when the stack is deleted or the resource is removed from the template. UpdateReplacePolicy: Retain preserves the old physical database during replacement; Snapshot preserves a backup instead of the database itself.