Canary Deployments to AWS Lambda - Modern Application Development on AWS

Canary Deployments to AWS Lambda

AWS CodeDeploy also supports canary deployments to AWS Lambda. AWS CodeDeploy uses Lambda’s traffic shifting capabilities to automate the gradual rollout of new function versions. This enables you to gradually shift traffic between two versions, and helps you reduce the risk and limit the impact of new Lambda deployments.

Figure 22 – Example architecture of a canary deployment in the AWS Cloud

When you perform AWS Lambda deployments with AWS CodeDeploy, you can use one of the following predefined deployment configuration options or you can create your own custom configuration. All of these options can also be used to deploy applications based on the Serverless Application Model (SAM).

Table 2 – Predefined deployment configuration options for canary deployments with AWS Lambda and AWS CodeDeploy

Deployment Configuration Description
CodeDeployDefault.LambdaCanary10Percent5Minutes Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 15 minutes later.
CodeDeployDefault.LambdaCanary10Percent10Minutes Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 10 minutes later.
CodeDeployDefault.LambdaCanary10Percent15Minutes Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 15 minutes later.
CodeDeployDefault.LambdaCanary10Percent30Minutes Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 30 minutes later.
CodeDeployDefault.LambdaLinear10PercentEvery1Minute Shifts 10 percent of traffic every minute until all traffic is shifted.
CodeDeployDefault.LambdaLinear10PercentEvery2Minutes Shifts 10 percent of traffic every two minutes until all traffic is shifted.
CodeDeployDefault.LambdaLinear10PercentEvery3Minutes Shifts 10 percent of traffic every three minutes until all traffic is shifted.
CodeDeployDefault.LambdaLinear10PercentEvery10Minutes Shifts 10 percent of traffic every 10 minutes until all traffic is shifted.
CodeDeployDefault.LambdaAllAtOnce Shifts all traffic to the updated Lambda functions at once.