Question #593
A development team uses AWS CloudFormation to deploy their application, which includes an Amazon RDS database. During a recent stack update, a developer accidentally modified the database's storage configuration, leading to its replacement and data loss. The team needs to ensure that such accidental replacements cannot occur in the future. Which solutions should they implement? (Choose two.)
Apply a CloudFormation Deletion Policy with the Retain value to the database resource.
Implement a stack policy that blocks updates to the database resource.
Configure the database to use Provisioned IOPS storage.
Use a CloudFormation stack set to manage deployments across environments.
Enable versioning for the CloudFormation template to track changes.
Explanation
Answer A (DeletionPolicy with Retain) ensures that if an RDS instance is replaced during a stack update, the old instance is retained, preserving data. Answer B (stack policy blocking updates) prevents any modifications to the RDS resource, avoiding accidental replacements.
Other options are incorrect: C (Provisioned IOPS) doesn't prevent replacement, D (stack sets) manages deployments but doesn't block changes, and E (versioning) tracks changes but doesn't prevent them. Key points: Use DeletionPolicy/UpdateReplacePolicy to retain resources and stack policies to restrict updates.
Answer
The correct answer is: AB