Course menuDVA-C03

Exams / DVA-C03 / AWS SAM, CloudFormation and CDK / Question 2

DVA-C03 practice question: AWS SAM, CloudFormation and CDK (2 of 3)

Testing and Deployment A free question from our original DVA-C03 practice exam. Try it, then open the answer to see why each option is right or wrong.

Last verified against current AWS documentation ·How we write our questions

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.

  1. A. Run drift detection on the stack and read the property differences that it reports for the DB instance.
  2. B. Create a change set from the edited template and review the Replacement value for the DB instance before executing it.
  3. C. Call ValidateTemplate on the edited template and read the response for any resources it would replace.
  4. D. 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.

Study

Keep practicing

Answer questions with a score at the end, or practice just this topic with the explanation after each one. No sign-up needed.

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