Which solution will meet these requirements?
Create an alias for every new deployed version of the Lambda function. Use the AWS CLI update-alias command with the routing-config parameter to distribute the load.
Deploy the application into a new CloudFormation stack. Use an Amazon Route 53 weighted routing policy to distribute the load.
Create a version for every new deployed Lambda function. Use the AWS CLI update-function-configuration command with the routing-config parameter to distribute the load.
Configure AWS CodeDeploy and use CodeDeployDefault.OneAtATime in the Deployment configuration to distribute the load.
Explanations:
Creating an alias for each new deployed version of the Lambda function allows for traffic routing between versions. Using the AWS CLIupdate-aliascommand with therouting-configparameter enables a canary deployment strategy by specifying the percentage of traffic to route to the new version, thus allowing for controlled testing before fully switching over.
Deploying the application into a new CloudFormation stack and using Amazon Route 53 weighted routing policy does not directly support canary releases for AWS Lambda functions. While Route 53 can distribute traffic, it is not designed to handle Lambda versioning or traffic shifting specific to Lambda.
While creating a version for every new deployed Lambda function is a necessary step for managing deployments, using the AWS CLIupdate-function-configurationcommand with therouting-configparameter is not the correct approach for implementing canary releases. The appropriate method involves updating aliases, not the function configuration itself.
Configuring AWS CodeDeploy withCodeDeployDefault.OneAtATimeallows for deploying changes in a controlled manner, but it is more suitable for EC2 and ECS deployments. This approach does not apply directly to AWS Lambda functions, which require a different mechanism for canary releases.