Course menuDOP-C02

Exams / DOP-C02 / Lambda deployments (aliases, traffic shifting, SAM) / Question 1

DOP-C02 practice question: Lambda deployments (aliases, traffic shifting, SAM) (1 of 2)

SDLC Automation A free question from our original DOP-C02 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

An insurance firm runs its claims-intake API as a set of AWS Lambda functions defined with AWS SAM. Claims adjusters use the API during business hours, and the team releases updates several times a week.

The team wants a new version of the claim-validation function to receive 10 percent of invocations at first. The remaining traffic should move after 5 minutes if the function's error alarm stays in OK, and if the alarm fires during the shift, traffic must return to the previous version automatically.

Developers want this configured in the same template as the function, with no separate deployment pipeline to maintain.

Which change meets these requirements with the LEAST operational overhead?

Choose one answer.

  1. A. Set AutoPublishAlias and a DeploymentPreference of Canary10Percent5Minutes in the SAM template, and list the error alarm so that CodeDeploy rolls back when it fires.
  2. B. Create a Lambda alias that sends 10 percent of invocations to the new version through weighted routing, and write a Step Functions state machine that raises the weight after 5 minutes.
  3. C. Deploy each new version as a separate Lambda function behind its own API Gateway stage, and change the custom domain mapping to the new function after the test team signs off.
  4. D. Keep the function at $LATEST and set reserved concurrency to 10 on the new version, so that only a tenth of the requests can reach the new code while the old code handles the rest.
Show the answer and explanation

Answer: A

Explanation

SAM deployment preferences use CodeDeploy to move a Lambda alias between versions in stages and roll back when a listed CloudWatch alarm fires. Declaring it in the template keeps the canary, the wait and the alarm together with the function, and the team writes no extra orchestration. Weighted aliases need custom code, cutovers are all or nothing, and concurrency settings do not choose code versions.

A canary deployment with alarm-based rollback Users reach the service through a traffic-shifting layer such as a Lambda alias, load balancer or endpoint. Most traffic goes to the current version and a small share goes to the new version. A CloudWatch alarm on the new version's errors rolls traffic back to the current version. Users Traffic shifting alias, ALB or endpoint Current version most traffic New version small share first CloudWatch alarm errors, latency roll back
Canary10Percent5Minutes sends a tenth of the traffic to the new version first, and the error alarm triggers rollback.

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 Lambda deployments (aliases, traffic shifting, SAM)? The 5 full-length practice sets have 7 more Lambda deployments (aliases, traffic shifting, SAM) questions, 375 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets