Lambda deployments (aliases, traffic shifting, SAM): DOP-C02 study notes and practice questions
What to know about Lambda deployments (aliases, traffic shifting, SAM) for the DOP-C02 exam, from the SDLC Automation domain (22% of the exam guide), then 2 free questions to test it. Part of the DOP-C02 study guide.
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.
AA. Set AutoPublishAlias and a DeploymentPreference of Canary10Percent5Minutes in the SAM template, and list the error alarm so that CodeDeploy rolls back when it fires.
BB. 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.
CC. 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.
DD. 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.
C. Wrong: Separate functions and stages make each release a full cutover rather than a gradual shift. Rolling back would need a mapping change and would not happen automatically.
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.
Canary10Percent5Minutes sends a tenth of the traffic to the new version first, and the error alarm triggers rollback.
A SaaS startup publishes a shared logging layer for AWS Lambda. The layer is used by 30 functions owned by teams in 12 accounts within one AWS Organization, and each function references a specific version of the layer by its ARN.
Layer versions cannot be changed after they are published. When the logging code needs a fix, every consuming team must be able to move its functions to the new version during its own deployment.
The layer must not be public, and no team may copy the logging code into its own function package.
Which approach meets these requirements?
Choose one answer.
AA. Overwrite the current layer version with the fixed code, so that every function picks up the change on its next cold start without any deployment.
BB. Publish a new layer version, grant the organization's ID permission to use it, and have each team move to the new version ARN in its own deployment.
CC. Make the layer public, so that every account can use it, and have each function reference the latest layer version ARN so that updates arrive automatically.
DD. Copy the logging code into each function's deployment package, remove the layer, and let each team control its own releases, since the layer is no longer shared.
D. Wrong: Copying the code into each package is exactly what the requirement forbids. It also multiplies the work of each fix across 30 functions and leaves each copy to drift.
Explanation
Lambda layer versions are immutable, and each one has its own ARN. A layer version permission can grant use to every account in an organization without making the layer public, and each team then points its functions at the new version during its own deployment. Overwriting versions, making the layer public or copying the code each miss a stated requirement.
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 →
Study Lambda deployments (aliases, traffic shifting, SAM)