A developer is managing a production infrastructure stack deployed via AWS CloudFormation. The stack contains an Amazon RDS DB instance and an Amazon ECS service. To prevent accidental replacement or deletion of the production database, the developer applies a stack policy to the stack. The policy contains a Deny statement for all update actions on the RDS DB instance resource, while allowing updates on all other resources.
The developer now needs to update the database engine version of the RDS DB instance. The developer attempts to perform a stack update with a template containing the new engine version, but the update fails due to the stack policy.
Which of the following is the correct method to update the database engine version while preserving the protective stack policy for future updates?
- AManually update the database engine version using the Amazon RDS console, and then perform a CloudFormation drift detection operation to automatically synchronize the change and update the CloudFormation stack template.
- BExecute the continue-update-rollback command and specify the RDS DB instance resource to be skipped, which bypasses the stack policy validation and forces the update to apply.
- Perform the stack update by using the AWS CLI update-stack command, passing a temporary stack policy that allows the update to the database resource in the --stack-policy-during-update-body parameter.Answer
- DStore the new engine version parameter in AWS Systems Manager Parameter Store as a SecureString, and reference it via a custom resource in the template to update the database engine version.