AWS Certified Developer – Associate (DVA-C02) — Question 444
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?
Answer options
- A. Create a weighted alias that references the production version of the function and the updated version of the function.
- B. Add a Network Load Balancer. Add the production version of the function and updated version of the function as targets.
- C. Use AWS CodeDeploy to create a linear traffic shifting deployment
- D. Create a tag for the Lambda function that contains the production version and updated version of the code.
Correct answer: A
Explanation
AWS Lambda allows you to shift traffic between two versions of a function by using a weighted alias, which is perfect for staging and testing new code alongside production. Network Load Balancers and CodeDeploy linear deployments do not directly support routing a split percentage of traffic to specific function versions in this static staging manner. Resource tags are only metadata and cannot be used to control execution flow or route traffic between different function versions.