A CloudFormation stack manages a production Amazon RDS DB instance.
A developer has edited several properties of the DB instance in the template. Before anything in production is touched, the developer wants to know whether CloudFormation would replace the database, and still wants to be able to approve the change afterwards.
What should the developer do?
Choose one answer.
AA. Run drift detection on the stack and read the property differences that it reports for the DB instance.
BB. Create a change set from the edited template and review the Replacement value for the DB instance before executing it.
CC. Call ValidateTemplate on the edited template and read the response for any resources it would replace.
DD. Update the stack with rollback disabled, and inspect the DB instance if the update fails part-way through.
Show the answer and explanation
Answer: B
A. Wrong: Drift detection compares the live resources with the template that the stack currently uses. It says nothing about how an edited template would be applied, so it cannot predict a replacement.
B. Right: Correct. A change set previews the changes to a stack without making them, including whether each resource would be replaced. The developer can then execute the change set to apply it or delete it to discard it. Learn more: Updating stacks using change sets (opens in a new tab)
C. Wrong: ValidateTemplate checks that the template is syntactically valid and lists its parameters. It does not compare the template with the running stack, so it cannot show a replacement.
D. Wrong: This applies the change to production instead of previewing it. A replacement would already have started by the time the developer could look.
Explanation
A change set previews how an updated template would change a stack, including which resources are modified or replaced, without making any changes. The developer can then execute or discard it. Drift detection, template validation and a live update do not give a pre-change replacement preview.
Want more on AWS SAM, CloudFormation and CDK? The 5 full-length practice sets have 15 more AWS SAM, CloudFormation and CDK questions, 390 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets →