Course menuDVA-C02

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

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

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

A CloudFormation stack includes an Amazon RDS DB instance. A developer is about to update the stack with a template that changes several properties of the DB instance. Before anything is changed, the developer wants to see whether the update would replace the database. What should the developer do?

Choose one answer.

  1. A. Run drift detection on the stack and review the drift results.
  2. B. Create a change set from the new template and review it before executing it.
  3. C. Update the stack with rollback turned off so the change can be inspected.
  4. D. Validate the new template with the ValidateTemplate API.
Show the answer and explanation

Answer: B

  • A. Wrong: Drift detection compares live resources with the current template. It does not preview a new template.
  • B. Right: Correct. A change set lists each resource that would be added, modified or replaced, and the stack is not touched until you execute it.
  • C. Wrong: This makes the change for real. If the database were replaced, it would already have happened.
  • D. Wrong: ValidateTemplate checks template syntax. It does not compare the template with the running stack.

Explanation

Change sets let you preview how proposed changes would affect a running stack, including whether a resource would be replaced, before you apply them. Creating a change set does not modify the stack, so it is a safe check before updating stateful resources such as databases.

Study

Keep practising

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