How to Configure a Staging Environment for AWS Lambda Using Weighted Aliases?
A developer is updating the code for an AWS Lambda function to add new capabilities. The Lambda function has version aliases for production and development environments that run separate versions of the function. The developer needs to configure a staging environment for the Lambda function to handle invocations to both the development version and the production version. Which solution will meet these requirements?
Community Votes
83% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the knowledge of Lambda aliases and weighted routing, specifically how to route traffic to multiple versions of a Lambda function simultaneously without needing external load balancers or deployment pipelines.
To configure a staging environment for an AWS Lambda function that handles invocations to both development and production versions, you must create a weighted alias. This alias routes a percentage of traffic to each specified function version.
Many candidates incorrectly choose AWS CodeDeploy (Option C) because it is commonly associated with traffic shifting. However, CodeDeploy is a deployment automation tool used to shift traffic over time, whereas the question simply asks to configure a staging environment that handles invocations to both versions simultaneously, which is natively achieved via a weighted alias.
Community Discussion (3 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Understanding AWS Lambda Aliases and Weighted Routing
The correct answer is A: Create a weighted alias that references the production version of the function and the updated version of the function.
An AWS Lambda alias is a named pointer to a specific Lambda function version. One of the most powerful features of Lambda aliases is weighted routing, which allows you to configure the alias to route a percentage of incoming invocations to one version, and the remaining percentage to another version. This is exactly what is needed to create a staging environment that handles invocations to both the development and production versions simultaneously.
As community members have pointed out, an alias can natively mix traffic between different versions, making it the simplest and most direct solution for this requirement.
Why the Other Options are Incorrect
- Option B (Network Load Balancer): While an Application Load Balancer (ALB) can target Lambda functions, a Network Load Balancer (NLB) cannot. Furthermore, using a load balancer is an overcomplicated, external solution when Lambda aliases natively support weighted traffic splitting.
- Option D (Tags): Tags in AWS are strictly metadata used for organization, billing, and resource identification. They have absolutely no capability to route traffic or invoke specific versions of a Lambda function.
Official Reference
Exam Strategy
When reading AWS Lambda questions, distinguish carefully between 'routing traffic to multiple versions' (which requires a weighted alias) and 'automating the gradual shift of traffic during a release' (which requires AWS CodeDeploy). Look for keywords like 'handle invocations to both' versus 'gradually shift' or 'deployment'.
Related Analysis
Practice All DVA-C02 Questions
Access 100 questions with complete answers and detailed explanations.
View Full DVA-C02 Practice Test →