Perform ECS blue/green deployments through CodeDeploy using CloudFormation - AWS CloudFormation

Perform ECS blue/green deployments through CodeDeploy using CloudFormation

To update an application running on Amazon Elastic Container Service (Amazon ECS), you can use a CodeDeploy blue/green deployment strategy. This strategy helps minimize interruptions caused by changing application versions.

In a blue/green deployment, you create a new application environment (referred to as green) alongside your current, live environment (referred to as blue). This allows you to monitor and test the green environment before routing live traffic from the blue environment to the green environment. After the green environment is serving live traffic, you can safely terminate the blue environment.

To perform CodeDeploy blue/green deployments on ECS using CloudFormation, you include the following information in your stack template:

  • A Hooks section that describes a AWS::CodeDeploy::BlueGreen hook.

  • A Transform section that specifies the AWS::CodeDeployBlueGreen transform.

The following topics guide you through setting up a CloudFormation template for a blue/green deployment on ECS.