There is a new Lambda Function developed using AWS CloudFormation Templates.
Which of the following attributes can be used to test the new Function with migrating 5% of traffic to the new version?
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer - A.
Routing-Config parameter of the Lambda alias allows one to point to two different versions of the Lambda function and determine what percentage of incoming traffic is sent to each version.
In the above case, a new version will be created to test the new function with 5 % of the traffic, while the original version will be used for the remaining 95% traffic.
Option B is incorrect since 5% of traffic needs to shift to a new function.
The routing-config parameter should be 0.05 & not 5.
Option C is incorrect since 5% of traffic needs to shift to a new function.
The routing-config parameter should be 0.05 & not 0.5.
Option D is incorrect since 5% of traffic needs to shift to a new function.
The routing-config parameter should be 0.05 & not 5%.
For more information on Pointing to the right version of Lambda function in CloudFormation, refer to the following URL-
https://docs.aws.amazon.com/lambda/latest/dg/lambda-traffic-shifting-using-aliases.htmlTo test the new Lambda Function with migrating 5% of traffic to the new version, we need to create an alias for the Lambda Function and use the routing configuration to specify the percentage of traffic that should be sent to the new version.
The correct answer is A. aws lambda create-alias --name alias name --function-name function-name --routing-config AdditionalVersionWeights={"2"=0.05}
Here's a detailed explanation of why:
An AWS Lambda Function can have multiple versions, and each version is identified by a unique version number. To control the traffic between different versions of a function, we can create an alias, which is a pointer to a specific version of the function.
When we create an alias, we can specify the percentage of traffic that should be routed to each version of the function using the routing configuration. In this case, we want to route 5% of traffic to the new version, so we need to set the AdditionalVersionWeights attribute to {"2"=0.05}, where "2" is the version number of the new version.
Here's what each of the options means:
A. aws lambda create-alias --name alias name --function-name function-name --routing-config AdditionalVersionWeights={"2"=0.05}
This option is correct. It creates an alias named "alias name" for the function named "function-name" and sets the percentage of traffic routed to version 2 to 5%.
B. aws lambda create-alias --name alias name --function-name function-name --routing-config AdditionalVersionWeights={"2"=5}
This option is incorrect. It sets the percentage of traffic routed to version 2 to 500%, which is not a valid value.
C. aws lambda create-alias --name alias name --function-name function-name --routing-config AdditionalVersionWeights={"2"=0.5}
This option is incorrect. It sets the percentage of traffic routed to version 2 to 50%, which is too high for our requirements.
D. aws lambda create-alias --name alias name --function-name function-name --routing-config AdditionalVersionWeights={"2"=5%}
This option is incorrect. The syntax of the value is not correct. We need to use a decimal value instead of a percentage value.