Which solution will meet these requirements?
Define a function version for the currently deployed production Lambda function. Update the API Gateway endpoint to reference the new Lambda function version. Upload and publish the optimized Lambda function code. On the production API Gateway stage, define a canary release and set the percentage of traffic to direct to the canary release. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Publish the API to the canary stage.
Define a function version for the currently deployed production Lambda function. Update the API Gateway endpoint to reference the new Lambda function version. Upload and publish the optimized Lambda function code. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Deploy a new API Gateway stage.
Define an alias on the $LATEST version of the Lambda function. Update the API Gateway endpoint to reference the new Lambda function alias. Upload and publish the optimized Lambda function code. On the production API Gateway stage, define a canary release and set the percentage of traffic to direct to the canary release. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Publish to the canary stage.
Define a function version for the currently deployed production Lambda function. Update the API Gateway endpoint to reference the new Lambda function version. Upload and publish the optimized Lambda function code. Update the API Gateway endpoint to use the $LATEST version of the Lambda function. Deploy the API to the production API Gateway stage.
Explanations:
This option suggests updating the API Gateway endpoint to reference the new Lambda function version after creating a canary release. However, it does not specify the correct method to implement canary releases since the API Gateway should reference the alias of the Lambda function instead of the version directly.
This option mentions updating the API Gateway to use the $LATEST version, which defeats the purpose of testing a new version with a small percentage of traffic. It should use a version or alias to allow for proper traffic distribution. Additionally, deploying a new API Gateway stage is unnecessary for canary testing.
This option correctly defines an alias on the $LATEST version of the Lambda function, allowing the API Gateway to reference the alias. It specifies implementing a canary release to control the traffic distribution, meeting the requirement of testing the changes in production without altering the API Gateway URL.
This option suggests updating the API Gateway to use the $LATEST version of the Lambda function, which does not facilitate controlled traffic distribution for canary testing. Using the $LATEST version is not appropriate for a production environment where controlled testing is necessary.