Exams / DVA-C02 / Deployment strategies and rollbacks / Question 1
DVA-C02 practice question: Deployment strategies and rollbacks (1 of 2)
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 Lambda function is deployed with AWS SAM using AutoPublishAlias: live. For each release, the team wants 10% of traffic to move to the new version, then all remaining traffic 10 minutes later, with an automatic rollback if an error alarm fires during the deployment. Which DeploymentPreference meets these requirements?
Choose one answer.
- AA. Type: Linear10PercentEvery10Minutes, with the error alarm listed under Alarms.
- BB. Type: Canary10Percent10Minutes, with the error alarm listed under Alarms.
- CC. Type: AllAtOnce, with a PostTraffic hook that checks the error alarm.
- DD. Type: Canary10Percent10Minutes, with the error alarm attached to the function's SNS destination.
Show the answer and explanation
Answer: B
- A. Wrong: Linear moves 10% every 10 minutes, so a full release would take about 100 minutes, not two steps.
- B. Right: Correct. Canary shifts 10% first and the rest after 10 minutes, and listed alarms trigger an automatic rollback.
- C. Wrong: All traffic moves at once, so there is no 10% step, and the hook only runs after the shift has finished.
- D. Wrong: The traffic shift is right, but the alarm must be listed in the deployment preference for CodeDeploy to roll back.
Explanation
SAM uses CodeDeploy to shift traffic between Lambda alias versions. Canary configurations move traffic in two steps, linear configurations in equal steps at fixed intervals, and AllAtOnce in one step. CloudWatch alarms listed under DeploymentPreference roll the deployment back automatically, and PreTraffic or PostTraffic hooks can run validation functions.
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.