Search⌘ K
AI Features

Gradual Deployments

Explore how to implement gradual deployments for AWS Lambda functions using AWS CodeDeploy and SAM. Understand routing configurations, traffic shifting with aliases, and deployment strategies like linear and canary to ensure safe and controlled updates without service disruption.

Routing configurations and AWS CodeDeploy #

An alias always points to some numerical version, but it can also point to more than one version at the same time. This becomes incredibly useful for safe deployments. Lambda supports automatic load balancing between versions assigned to the same alias, using a feature called routing configuration.

Another AWS deployment product, called AWS CodeDeploy, can modify the routing configuration over time to gradually switch aliases between several versions of code and infrastructure. CodeDeploy can, for example, use the new version of an application only for 10% of the traffic and wait for a short period while monitoring for unexpected problems. If everything looks OK, CodeDeploy can expose the new version to everyone and shut down the old version. On the other hand, if the new version seems to be problematic, CodeDeploy will move all the users back to the old infrastructure and destroy the experimental version. Reassigning aliases to published configuration versions is very quick (much faster than a redeployment) making it easy and quick to recover from deployment errors.

SAM automates most of the heavy lifting when setting up gradual deployments. It will automatically create CodeDeploy ...