Your application currently points to several Lambda functions in AWS.
A change is being made to one of the Lambda functions.
You need to ensure that application traffic is shifted slowly from one Lambda function to the other.
Which of the following steps would you carry out? Select 2 Options.
Click on the arrows to vote for the correct answer
A. B. C. D. E.Answer - A and B.
This is mentioned in the AWS Documentation.
By default, an alias points to a single Lambda function version.
When the alias is updated to point to a different function version, incoming request traffic instantly points to the updated version.
This exposes that alias to any potential instabilities introduced by the new version.
To minimize this impact, you can implement the routing-config parameter of the Lambda alias that allows you to point to two different versions of the Lambda function and dictate what percentage of incoming traffic is sent to each version.
Options C and D are incorrect since you need to use ALIAS for this purpose.
Option E is incorrect because A & B are the correct ways to achieve the requirement.
For more information on shifting traffic using ALIAS, please refer to the below URL-
https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.htmlTo ensure a slow traffic shift from one Lambda function to another, you can use the AWS Lambda's built-in traffic shifting feature, which allows you to gradually shift traffic from one function version to another, or from one alias to another, using weighted percentages.
To implement the traffic shifting, you can perform the following steps:
create-function
command and the --publish
parameter.Example CLI command to create a new version of a Lambda function:
cssaws lambda create-function --function-name my-function \ --code S3Bucket=my-bucket,S3Key=my-code.zip --runtime nodejs14.x \ --handler index.handler --role my-execution-role --publish
create-alias
command.Example CLI command to create an alias for a Lambda function:
raws lambda create-alias --function-name my-function \ --name prod --function-version 2
update-alias
command and the --routing-config
parameter.Example CLI command to update an alias with a routing configuration:
cssaws lambda update-alias --function-name my-function \ --name prod --routing-config '{"AdditionalVersionWeights":{"3":0.5}}'
The --routing-config
parameter specifies the percentage of traffic that should be shifted to the new version (in this case, 50%). You can specify additional version weights to gradually shift traffic to multiple versions.
Overall, to gradually shift traffic from one Lambda function to another, you need to create a new version of the function, create an alias for the new version, and update the existing alias with a routing configuration to gradually shift traffic to the new version.