DVA-C02 Deployment Practice Question
An organization uses AWS Lambda functions behind an Amazon API Gateway REST API. They want to deploy a new version of the Lambda function using canary deployments. What is the recommended approach?
⚠ Common exam trap
Candidates often get confused between manual Lambda alias traffic shifting (Option D) and automated canary deployments. While you can manually adjust alias weights, it is not the recommended approach for deployments because it lacks automated rollback capabilities. AWS SAM with DeploymentPreference (Option C) is the standard AWS-recommended best practice.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Deploy the new Lambda version using AWS SAM with AutoPublishAlias and DeploymentPreference.
AWS SAM (Serverless Application Model) provides built-in support for safe Lambda deployments. By defining the `AutoPublishAlias` and `DeploymentPreference` (such as `Canary10Percent10Minutes`) in the SAM template, AWS SAM automatically configures AWS CodeDeploy to gradually shift traffic to the new Lambda version. It also monitors CloudWatch alarms and automatically rolls back if any errors are detected, making it the recommended and most robust approach.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use AWS CodeDeploy to create a canary deployment for the Lambda function.
Why it's wrong here
AWS CodeDeploy manages traffic shifting between Lambda aliases, but it cannot natively control the routing logic of an Amazon API Gateway REST API. It lacks the mechanism to manipulate API Gateway stages or custom domain names required for this specific architecture. This approach is intended for automating deployment workflows within AWS CodePipeline where you need to manage versioning and rollback through Lambda aliases during a continuous delivery process.
- ✗
Use API Gateway canary release deployment to shift traffic to the new Lambda version.
Why it's wrong here
API Gateway canary deployments are designed to gradually roll out changes to the API Gateway stage configuration itself, such as new resource paths, methods, or integration types. While an API Gateway stage integrates with a Lambda function, its canary release mechanism does not directly manage or shift traffic between different versions of the same backend Lambda function using aliases. This feature is for deploying changes to the API definition, not for manipulating the underlying Lambda alias traffic weights.
- ✓
Deploy the new Lambda version using AWS SAM with AutoPublishAlias and DeploymentPreference.
Why this is correct
While AWS SAM's AutoPublishAlias and DeploymentPreference properties can automate the creation of Lambda aliases and integrate with AWS CodeDeploy for controlled deployments, this option describes an orchestration tool rather than the direct mechanism for traffic shifting. CodeDeploy, when used with SAM, manages the *process* of shifting traffic between Lambda aliases by updating the alias configuration over time. However, the question asks for the specific Lambda feature that enables traffic shifting, not the deployment pipeline that orchestrates it.
- ✗
Configure the Lambda function alias with traffic shifting using weights.
Why it's wrong here
Lambda function aliases provide a stable endpoint for invoking a function while allowing you to point the alias to different Lambda function versions. Crucially, an alias can be configured with traffic shifting, enabling you to specify a weighted distribution of invocations between two different Lambda versions (e.g., 90% to a stable version and 10% to a new version). This allows for controlled, gradual rollouts and easy rollbacks directly within the Lambda service, making it the most direct and appropriate method for canary deployments in this scenario.
Quick reference
Cloud Service Model Comparison
| Model | You Manage | Provider Manages | Examples |
|---|---|---|---|
| IaaS | OS, runtime, apps, data | Hardware, hypervisor, networking | EC2, Azure VMs, GCP Compute Engine |
| PaaS | Apps and data | OS, runtime, middleware, hardware | Elastic Beanstalk, Azure App Service |
| SaaS | Data and settings only | Everything else | Microsoft 365, Salesforce, Workday |
| FaaS / Serverless | Function code only | Infra, scaling, runtime | Lambda, Azure Functions, Cloud Run |
| CaaS | Containers and apps | Kubernetes, OS, hardware | EKS, AKS, GKE |
Go deeper
Related to this question
About these practice questions
This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This DVA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DVA-C02 exam.