A developer is configuring an AWS CloudFormation template to deploy an application that requires a database password. The password must be stored securely and rotated automatically every 30 days. Additionally, the developer must ensure that if a stack update fails, the resources are reverted to their previous working state. Which CloudFormation configurations and features should the developer use to meet these requirements? (Select TWO.)
- Use a CloudFormation dynamic reference to retrieve the database password from AWS Secrets Manager.Answer
- Allow the default CloudFormation behavior to roll back the stack automatically to its last stable state if the update fails.Answer
- CUse a Systems Manager Parameter Store dynamic reference to retrieve the password, and configure Parameter Store to rotate the secret every 30 days.
- DChange the password manually using the Amazon RDS console, then execute a CloudFormation drift detection operation to update the stack's template parameters.
- EDisable the stack's rollback-on-failure setting and execute the AWS CLI command to manually reconcile and clean up the database state.
Answer
To securely reference a rotating password and ensure automatic rollback on failure, the developer should use a dynamic reference to retrieve the database password from AWS Secrets Manager and allow CloudFormation to execute its default automatic rollback behavior.
To retrieve a secret that rotates automatically, using a dynamic reference to AWS Secrets Manager is the correct choice because Secrets Manager natively handles automatic secret rotation. Allowing the default CloudFormation rollback behavior ensures that any failed updates are automatically reverted to the last stable configuration without manual intervention.
Step-by-Step Solution
Key Concept
AWS CloudFormation manages resources declaratively. Using dynamic references to AWS Secrets Manager handles rotating credentials securely, while default stack rollback behavior ensures automated state recovery from update failures.
Estimated Time:1m 0s