Question #1063
A developer is configuring an AWS Lambda function to test a new version alongside the existing production version. The Lambda function uses version aliases to manage deployments across environments. The developer needs to route a percentage of incoming traffic to the new version while keeping the majority on the production version during testing.
Which solution will meet these requirements?
Create a weighted alias that distributes traffic between the production version and the new version of the function.
Deploy an Application Load Balancer and register both the production version and new version as target groups.
Use AWS Step Functions to orchestrate invocations to both versions of the Lambda function.
Apply a resource-based policy to the Lambda function allowing access to both versions.
Explanation
Answer A is correct because AWS Lambda's weighted alias feature allows developers to split traffic between two versions of a function by assigning weights (e.g., 90% to production, 10% to the new version). This aligns with the requirement to test a new version alongside production.
Option B is incorrect because deploying an Application Load Balancer (ALB) adds unnecessary complexity; Lambda aliases natively support traffic shifting without requiring ALB. Option C is incorrect because AWS Step Functions orchestrates workflows but does not manage traffic routing between Lambda versions. Option D is irrelevant, as resource-based policies control access permissions, not traffic distribution. Key takeaway: Use Lambda's weighted aliases for percentage-based traffic routing between versions during deployments.
Answer
The correct answer is: A