Updating a service using the classic console - Amazon Elastic Container Service
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China.

Updating a service using the classic console

Important

Amazon ECS has provided a new console experience for updating a service. For more information, see Updating a service using the new console.

To update a running service

  1. Open the Amazon ECS console at https://console.amazonaws.cn/ecs/.

  2. On the navigation bar, select the Region that your cluster is in.

  3. In the navigation pane, choose Clusters.

  4. On the Clusters page, select the name of the cluster in which your service resides.

  5. On the Cluster: name page, choose Services.

  6. Check the box to the left of the service to update and choose Update.

  7. On the Configure service page, your service information is pre-populated. Change the task definition, capacity provider strategy, platform version, deployment configuration, or number of desired tasks (or any combination of these). To have your service start a new deployment, which will stop and relaunch all tasks using the new configuration, select Force new deployment. Choose Next step when finished changing the service configuration.

    Note

    A service using an Auto Scaling group capacity provider can't be updated to use a Fargate capacity provider and vice versa.

    A service using a Linux platform version can't be updated to use a Windows platform version and vice versa.

  8. On the Configure deployments page, if your service is using the blue/green deployment type, the components of your service deployment is pre-populated. Confirm the following settings.

    1. For Application name, choose the CodeDeploy application of which your service is a part.

    2. For Deployment group name, choose the CodeDeploy deployment group of which your service is a part.

    3. Select the deployment lifecycle event hooks and the associated Lambda functions to execute as part of the new revision of the service deployment. The available lifecycle hooks are:

      • BeforeInstall – Use this deployment lifecycle event hook to invoke a Lambda function before the replacement task set is created. The result of the Lambda function at this lifecycle event does not trigger a rollback.

      • AfterInstall – Use this deployment lifecycle event hook to invoke a Lambda function after the replacement task set is created. The result of the Lambda function at this lifecycle event can trigger a rollback.

      • BeforeAllowTraffic – Use this deployment lifecycle event hook to invoke a Lambda function before the production traffic has been rerouted to the replacement task set. The result of the Lambda function at this lifecycle event can trigger a rollback.

      • AfterAllowTraffic – Use this deployment lifecycle event hook to invoke a Lambda function after the production traffic has been rerouted to the replacement task set. The result of the Lambda function at this lifecycle event can trigger a rollback.

      For more information about lifecycle hooks, see AppSpec 'hooks' Section in the Amazon CodeDeploy User Guide.

  9. Choose Next step.

  10. On the Configure network page, your network information is pre-populated. In the Load balancing section, if your service is using the blue/green deployment type, select the listeners to associate with the target groups. Change the health check grace period (if desired) and choose Next step.

  11. (Optional) You can use Service Auto Scaling to scale your service up and down automatically in response to CloudWatch alarms.

    1. Under Optional configurations, choose Configure Service Auto Scaling.

    2. Proceed to Step 5: Configuring your service to use Service Auto Scaling.

    3. Complete the steps in that section and then return.

  12. Choose Update Service to finish and update your service.