A serverless app uses API Gateway to invoke a Lambda function. A developer fixes a bug in the Lambda code and wants to route 10% of live production traffic to the new Lambda version to test it. Which steps should the developer take? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Publish a new version of the Lambda function that contains the updated code., Create an alias for the Lambda function and configure weighted routing on that alias, assigning 10% to the new version..
Why this is the answer
To implement canary deployments or gradual rollouts for Lambda functions, you first need to publish a new version of the Lambda function containing the updated code. This creates an immutable snapshot of your code and configuration. Then, you create an alias for the Lambda function. Aliases can point to specific versions of a function and allow you to configure weighted routing, directing a percentage of traffic to one version and the remaining traffic to another. In this scenario, you would configure the alias to send 10% of traffic to the new version and 90% to the current production version. Creating a new API Gateway stage and enabling weighted routing between stages is incorrect because API Gateway stages primarily manage different deployment environments for the API itself, not traffic distribution between different Lambda function versions invoked by a single API endpoint. Network Load Balancers are used for distributing traffic to EC2 instances or containers, not directly to Lambda functions. Amazon Route 53 weighted routing policies are for directing traffic to different endpoints based on DNS, which is not the mechanism for managing Lambda function version traffic.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed