Create an application for an Amazon ECS service deployment (console)
You can use the CodeDeploy console to create an application for an Amazon ECS service deployment.
Sign in to the Amazon Web Services Management Console and open the CodeDeploy console at https://console.amazonaws.cn/codedeploy
. Note
Sign in with the same user that you set up in Getting started with CodeDeploy.
In the navigation pane, expand Deploy, and choose Getting started.
-
On the Create application page, choose Use CodeDeploy.
-
In Application name, enter the name of your application.
-
From Compute platform, choose Amazon ECS.
-
Choose Create application.
-
On your application page, from the Deployment groups tab, choose Create deployment group. For more information about what you need to create a deployment group for an Amazon ECS deployment, see Before you begin an Amazon ECS deployment.
-
In Deployment group name, enter a name that describes the deployment group.
Note
If you want to use the same settings used in another deployment group (including the deployment group name and the deployment configuration), choose those settings on this page. Although this new group and the existing group might have the same name, CodeDeploy treats them as separate deployment groups, because each is associated with a separate application.
-
In Service role, choose a service role that grants CodeDeploy access to Amazon ECS. For more information, see Step 2: Create a service role for CodeDeploy.
-
From Load balancer name, choose the name of the load balancer that serves traffic to your Amazon ECS service.
-
From Production listener port, choose the port and protocol for the listener that serves production traffic to your Amazon ECS service.
-
(Optional) From Test listener port, choose the port and protocol of a test listener that serves traffic to the replacement task set in your Amazon ECS service during deployment. You can specify one or more Lambda funtions in the AppSpec file that run during the
AfterAllowTestTraffic
hook. The functions can run validation tests. If a validation test fails, a deployment rollback is triggered. If the validation tests succeed, the next hook in the deployment lifecycle,BeforeAllowTraffic
, is triggered. If a test listener port is not specified, nothing happens during theAfterAllowTestTraffic
hook. For more information, see AppSpec 'hooks' section for an Amazon ECS deployment. -
From Target group 1 name and Target group 2 name, choose the target groups used to route traffic during your deployment. CodeDeploy binds one target group to your Amazon ECS service's original task set and the other to its replacement task set. For more information, see Target Groups for Your Application Load Balancers.
-
Choose Reroute traffic immediately or Specify when to reroute traffic to determine when to reroute traffic to your updated Amazon ECS service.
If you choose Reroute traffic immediately, then the deployment automatically reroutes traffic after the replacement task set is provisioned.
If you choose Specify when to reroute traffic, then choose the number of days, hours, and minutes to wait after the replacement task set is successfully provisioned. During this wait time, validation tests in Lambda functions specified in the AppSpec file are executed. If the wait time expires before traffic is rerouted, then the deployment status changes to
Stopped
. -
For Original revision termination, choose the number of days, hours, and minutes to wait after a successful deployment before the original task set in your Amazon ECS service is terminated.
-
(Optional) In Advanced, configure any options you want to include in the deployment, such as Amazon SNS notification triggers, Amazon CloudWatch alarms, or automatic rollbacks.
For more information, see Configure advanced options for a deployment group.