Jeff’s Note #
Unlike generic exam dumps, ADH analyzes this scenario through the lens of a Real-World Lead Developer.
For AWS DVA-C02 candidates, the confusion often lies in how to combine Lambda versioning, aliases, and API Gateway stages to achieve traffic shifting during a production test, without breaking your existing API URL. In production, this is about knowing exactly how Lambda aliases and API Gateway canary deployments interplay to enable safe, incremental rollout testing. Let’s drill down.
The Certification Drill (Simulated Question) #
Scenario #
A software company, BrightApps, operates a serverless REST API backed by AWS Lambda and Amazon API Gateway. A lead developer needs to deploy a new optimized version of an existing Lambda function. They want to test this updated function in the live environment by directing only a small percentage of real user traffic to it — all while keeping the original API Gateway URL unchanged for clients. The goal is to validate the new Lambda code in production safely before full rollout.
The Requirement: #
Deploy the updated Lambda function version and configure the API Gateway integration so that a small defined portion of production requests hit the new Lambda version, without changing the public API URL.
The Options #
-
A) Define a function version for the currently deployed production Lambda function. Update the API Gateway endpoint to reference the new Lambda function version. Upload and publish the optimized Lambda function code. On the production API Gateway stage, define a canary release and set the percentage of traffic to direct to the canary release. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Publish the API to the canary stage.
-
B) Define a function version for the currently deployed production Lambda function. Update the API Gateway endpoint to reference the new Lambda function version. Upload and publish the optimized Lambda function code. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Deploy a new API Gateway stage.
-
C) Define an alias on the $LATEST version of the Lambda function. Update the API Gateway endpoint to reference the new Lambda function alias. Upload and publish the optimized Lambda function code. On the production API Gateway stage, define a canary release and set the percentage of traffic to direct to the canary release. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Publish to the canary stage.
-
D) Define a function version for the currently deployed production Lambda function. Update the API Gateway endpoint to reference the new Lambda function version. Upload and publish the optimized Lambda function code. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Deploy the API to the production API Gateway stage.
Google adsense #
leave a comment:
Correct Answer #
C
Quick Insight: The DVA-C02 Imperative #
For developers, mastering Lambda versioning combined with aliases is key. Only option C correctly uses a Lambda alias as a stable pointer for API Gateway integration and leverages API Gateway’s canary deployment support on the production stage to direct a configurable percentage of traffic to the new Lambda version — all while preserving the same API URL.
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 C
The Winning Logic #
Option C correctly uses a Lambda alias as the stable integration point for API Gateway. This alias points to the tested version of the Lambda function, and API Gateway’s canary release feature on the production stage allows you to shift a controlled percentage of traffic to the alias’s Lambda version, without changing the API endpoint URL clients use.
- Creating a Lambda alias tied to the $LATEST version allows incremental updates without clients invoking $LATEST directly, which is unstable.
- Using API Gateway canary deployments on the production stage enables shifting a configurable percentage of requests to the new Lambda alias version safely.
- This approach avoids deploying new API stages or changing the URL, meeting the requirement precisely.
The Trap (Distractor Analysis): #
-
Why not A? The answer tries to reference new Lambda versions directly in the API Gateway endpoint and mixes $LATEST with versions inconsistently. Also, configuring canary deployments without leveraging Lambda aliases is flawed because API Gateway cannot do traffic shifting properly without alias integration.
-
Why not B? Deploying a new API Gateway stage changes the URL path and does not leverage canary deployment traffic shifting; all traffic goes to one version only.
-
Why not D? This option also updates the API Gateway endpoint to $LATEST and redeploys the production stage, lacking any traffic weighting or canary release - which means no partial production testing.
The Technical Blueprint #
Code Snippet: Creating Alias and Updating API Gateway Integration #
# Publish a new version of the Lambda function
aws lambda publish-version --function-name MyFunction
# Create or update alias 'prod' to point to new version
aws lambda update-alias --function-name MyFunction --name prod --function-version 2
# Update API Gateway integration to invoke Lambda alias 'prod'
aws apigateway update-integration --rest-api-id xyz123 --resource-id abc456 --http-method POST \
--patch-operations op=replace,path=/uri,value=arn:aws:apigateway:region:lambda:path/2015-03-31/functions/arn:aws:lambda:region:account-id:function:MyFunction:prod/invocations
# Configure canary deployment on the API Gateway prod stage to shift 10% traffic
aws apigateway update-stage --rest-api-id xyz123 --stage-name prod \
--patch-operations op=replace,path=/canarySettings/percentTraffic,value=0.10
The Comparative Analysis #
| Option | Lambda Versioning | API Gateway Stage Usage | Canary Supported | URL Consistency | Comments |
|---|---|---|---|---|---|
| A | Versions only | Canary stage attempted | Partial (incorrect setup) | No | Mixes $LATEST, no alias used |
| B | Versions | New stage | No | No | New URL, no traffic shifting |
| C | Alias + version | Production stage + canary | Yes (correct) | Yes | Correct and best practice |
| D | Versions | Production stage | No | Yes | No traffic splitting capability |
Real-World Application (Practitioner Insight) #
Exam Rule #
For the exam, always pick Lambda Alias + API Gateway Canary Deployment when you see fractional traffic testing or production validation without URL change.
Real World #
In production, teams often automate this using CI/CD pipelines with AWS SAM or CloudFormation to push Lambda versions, update aliases, and configure API Gateway stages with Canary settings — ensuring safe blue-green style deploys with minimal client impact.
(CTA) Stop Guessing, Start Mastering #
Disclaimer
This is a study note based on simulated scenarios for the AWS DVA-C02 exam.