Tutorial: Deploy an Amazon ECS service - AWS CodeDeploy

Tutorial: Deploy an Amazon ECS service

In this tutorial, you learn how to deploy an Amazon ECS application. You start with an Amazon ECS application you already created. The first step is to update your application by modifying its task definition file with a new tag. Next, you use CodeDeploy to deploy the update. During deployment, CodeDeploy installs your update into a new, replacement task set. Then, it shifts production traffic from the original version of your Amazon ECS service, which is in its original task set, to the updated version in the replacement task set.

Note

CodeDeploy does not currently support Amazon ECS Capacity Provider.

During an Amazon ECS deployment, CodeDeploy uses a load balancer that is configured with two target groups and one production traffic listener. The following diagram shows how the load balancer, production listener, target groups, and your Amazon ECS application are related before the deployment starts. This tutorial uses an Application Load Balancer. You can also use a Network Load Balancer.

After a successful deployment, the production traffic listener serves traffic to your new replacement task set and the original task set is terminated. The following diagram shows how your resources are related after a successful deployment. For more information, see What happens during an Amazon ECS deployment.

For information about how to use the AWS CLI to deploy an Amazon ECS service, see Tutorial: Creating a service using a blue/green deployment. For information about how to use CodePipeline to detect and automatically deploy changes to an Amazon ECS service with CodeDeploy, see Tutorial: Create a pipeline with an Amazon ECR source and ECS-to-CodeDeploy deployment.

After you complete this tutorial, you can use the CodeDeploy application and deployment group you created to add a deployment validation test in Tutorial: Deploy an Amazon ECS service with a validation test.