AWS Certified Developer – Associate (DVA-C02) — Question 410
A developer uses an AWS Lambda function in an application to edit users' uploaded photos. The developer needs to update the Lambda function code and needs to test the updates.
For testing, the developer must divide the user traffic between the original version of the Lambda function and the new version of the Lambda function.
Which combination of steps will meet these requirements? (Choose two.)
Answer options
- A. Publish a version of the original Lambda function. Make the necessary changes to the Lambda code. Publish a new version of the Lambda function.
- B. Use AWS CodeBuild to detect updates to the Lambda function. Configure CodeBuild to incrementally shift traffic from the original version of the Lambda function to the new version of the Lambda function.
- C. Update the original version of the Lambda function to add a function URL. Make the necessary changes to the Lambda code. Publish another function URL for the updated Lambda code.
- D. Create an alias that points to the original version of the Lambda function. Configure the alias to be a weighted alias that also includes the new version of the Lambda function. Divide traffic between the two versions.
- E. Create an alias that points to the original function URL. Configure the alias to be a weighted alias that also includes the additional function URL. Divide traffic between the two function URLs.
Correct answer: A, D
Explanation
To implement traffic shifting in AWS Lambda, you must first publish distinct, immutable versions of the function, which is achieved by publishing the original and updated versions (Option A). Next, you create a weighted Lambda alias that references both of these published versions and routes a specified percentage of traffic to each (Option D). AWS CodeBuild cannot manage Lambda traffic routing (Option B), and Lambda function URLs do not support weighted alias routing directly (Options C and E).