DVA-C02 · Question #525
A company is building a social media application. A developer is modifying an AWS Lambda function that updates a database with data that tracks each user's online activity. A web application server…
The correct answer is B. Create an alias for the Lambda function. Configure a specific weight value for the updated. Lambda aliases support weighted traffic routing between two function versions, enabling a canary rollout where only a configured percentage of invocations execute the new code.
Question
A company is building a social media application. A developer is modifying an AWS Lambda function that updates a database with data that tracks each user's online activity. A web application server uses the AWS SDK to invoke the Lambda function. The developer has tested the new Lambda code and is ready to deploy the code into production. However, the developer wants to allow only a small percentage of the invocations from the AWS SDK to call the new code. Which solution will meet these requirements?
Options
- AConfigure a Lambda version that has a specific weight value for the updated Lambda function.
- BCreate an alias for the Lambda function. Configure a specific weight value for the updated
- CCreate an Application Load Balancer. Specify weighted target groups for the original Lambda
- DCreate a Network Load Balancer. Specify weighted target groups for the original Lambda function
How the community answered
(47 responses)- A15% (7)
- B72% (34)
- C4% (2)
- D9% (4)
Why each option
Lambda aliases support weighted traffic routing between two function versions, enabling a canary rollout where only a configured percentage of invocations execute the new code.
Lambda versions are immutable snapshots and do not themselves support weight values; weighted routing is a feature of aliases, not versions.
A Lambda alias can point to two different function versions simultaneously using a weighted routing configuration. By assigning, for example, 5% weight to the updated version and 95% to the original, only that fraction of AWS SDK invocations will execute the new code. This allows production validation of the new logic without exposing all users to it.
Application Load Balancers support weighted target groups for HTTP-based routing but are not the appropriate mechanism for controlling which Lambda function version is invoked by an SDK call.
Network Load Balancers operate at Layer 4 (TCP/UDP) and do not provide weighted routing to Lambda function versions invoked via the AWS SDK.
Concept tested: Lambda alias weighted traffic routing between versions
Source: https://docs.aws.amazon.com/lambda/latest/dg/configuration-aliases.html
Community Discussion
No community discussion yet for this question.