AWS Certified Developer – Associate / Question #757 of 557

Question #757

A company runs a serverless application on AWS using AWS Lambda functions with versions and aliases. They currently deploy updates manually but want to transition to an AWS-native traffic-shifting strategy to gradually roll out new versions to a predefined percentage of users. Which solution will achieve this goal?

A

Configure traffic routing using a weighted alias for the Lambda function versions.

B

Implement a canary deployment configuration for the Lambda function.

C

Use environment variables to manage traffic distribution between Lambda versions.

D

Set up a linear deployment configuration for the Lambda function.

Explanation

Answer A is correct because AWS Lambda aliases support traffic routing using weighted configurations. This allows assigning specific percentages of traffic to different Lambda versions, enabling gradual rollouts. The alias acts as a pointer to manage traffic distribution natively within Lambda.

Answer B (canary deployment) typically involves AWS CodeDeploy, which is not explicitly mentioned here. While CodeDeploy is AWS-native, the question focuses on Lambda's built-in capabilities.
Answer C is incorrect because environment variables cannot control traffic routing between versions; they handle configuration, not invocation distribution.
Answer D (linear deployment) also relies on CodeDeploy and involves shifting traffic incrementally over time, which isn't the same as predefined percentage-based routing.

Key Points:
- Lambda aliases with weighted routing enable traffic shifting without additional services.
- Canary/linear deployments require AWS CodeDeploy, which isn't referenced in the question.
- Environment variables and manual methods don't manage traffic distribution between versions.

Answer

The correct answer is: A