Jeff’s Note #
Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.
For DVA-C02 candidates, the confusion often lies in how to configure safe Lambda deployments via AWS SAM traffic shifting. In production, this is about knowing exactly which DeploymentPreference type to pick to meet precise rollout timing and percentage goals without manual intervention. Let’s drill down.
The Certification Drill (Simulated Question) #
Scenario #
TechWare Innovations is developing a serverless backend using AWS SAM and Lambda for their new customer management system. Their deployment pipeline must support safe Lambda version promotions. After deploying a new Lambda version, they want 10% of user traffic to be routed to the new version for exactly 10 minutes to monitor for errors. If no issues arise, the system should automatically switch 100% of traffic to the new Lambda version, minimizing downtime and ensuring smooth rollouts.
The Requirement: #
Which modification to the AWS SAM template will implement this canary deployment strategy exactly as described?
The Options #
- A) Set the Deployment Preference Type to
Canary10Percent10Minutes. Set theAutoPublishAliasproperty to the Lambda Alias. - B) Set the Deployment Preference Type to
Linear10PercentEvery10Minutes. Set theAutoPublishAliasproperty to the Lambda Alias. - C) Set the Deployment Preference Type to
Canary10Percent10Minutes. Set thePreTrafficandPostTrafficproperties to the Lambda alias. - D) Set the Deployment Preference Type to
Linear10PercentEvery10Minutes. Set thePreTrafficandPostTrafficproperties to the Lambda alias.
Google adsense #
leave a comment:
Correct Answer #
A
Quick Insight: The Developer Imperative #
The key is knowing that the
Canary10Percent10Minutesdeployment preference in AWS SAM automatically directs 10% of traffic to the new version for 10 minutes before shifting all traffic if no errors occur. TheAutoPublishAliaslinks the deployment preference to the Lambda Alias for smooth version management. This is simpler and more precise than linear increments or manual PreTraffic/PostTraffic hooks.
Content Locked: The Expert Analysis #
You’ve identified the answer. But do you know the implementation details that separate a Junior from a Senior?
The Expert’s Analysis #
Correct Answer #
Option A
The Winning Logic #
When configuring safe deployments with AWS SAM for Lambda, setting the DeploymentPreference to Canary10Percent10Minutes instructs CloudFormation to route exactly 10% of the traffic to the new Lambda version for 10 minutes automatically, before shifting 100% if no alarms are triggered. The AutoPublishAlias is necessary to automate version publishing and alias adjustment seamlessly during deployments.
- The
Canarydeployment mode is the only one that meets the requirement for a one-time 10% traffic shift lasting exactly 10 minutes. AutoPublishAliassimplifies continuous deployment pipelines by creating/updating Lambda versions and aliases, integrating tightly with deployment preferences.
The Trap (Distractor Analysis): #
- Option B incorrectly uses the
Linear10PercentEvery10Minutesdeployment preference. This will shift 10% of traffic every 10 minutes, meaning it would take 100 minutes total for full deployment, violating the “first 10 minutes alone” requirement. - Options C and D introduce manual
PreTrafficandPostTraffichooks, which are unnecessary here and increase complexity. They require Lambda functions to be manually run before/after shifting traffic, adding overhead not specified in the requirement. - Also, only
Canary10Percent10Minutesmatches the desired traffic shifting strategy precisely.
The Technical Blueprint #
# AWS SAM snippet fragment illustrating correct usage:
Globals:
Function:
AutoPublishAlias: live
Resources:
MyFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./src
Handler: app.lambdaHandler
Runtime: nodejs18.x
DeploymentPreference:
Type: Canary10Percent10Minutes
This config tells CloudFormation to deploy the Lambda function incrementally using a 10% canary for 10 minutes before full promotion.
The Comparative Analysis #
| Option | API Complexity | Performance | Use Case |
|---|---|---|---|
| A | Low (built-in support) | Immediate 10% traffic shift for 10 minutes | Canary deployments for quick rollback and safe rollout |
| B | Low | Slower rollout over 100 minutes (linear) | Gradual traffic shifting over time |
| C | High (manual hooks) | Requires additional Lambda functions to run pre/post deployment | Custom tasks around traffic shifting |
| D | High (manual hooks) | Same as C | Same as C |
Real-World Application (Practitioner Insight) #
Exam Rule #
For the exam, always pick Canary10Percent10Minutes deployment preference when the question specifies a quick canary traffic shift with automatic promotion.
Real World #
In real environments, sometimes teams choose Linear deployments for steady gradual rollouts to reduce risk further, but this adds latency before full traffic shift.
(CTA) Stop Guessing, Start Mastering #
Disclaimer
This is a study note based on simulated scenarios for the DVA-C02 exam.