Skip to content

Instantly share code, notes, and snippets.

@samclane
Created July 2, 2019 21:30
Show Gist options
  • Save samclane/81d1d67d9629983ca122b7846f22e575 to your computer and use it in GitHub Desktop.
Save samclane/81d1d67d9629983ca122b7846f22e575 to your computer and use it in GitHub Desktop.
How to scale down an AWS ECS instance to 0 so it can be deleted
  1. Using service-definition.json, find the values of serviceName and cluster

  2. Run the following:

    aws ecs update-service --service <serviceName> --cluster <cluster> --desired-count 0

  3. This scales down the service to 0 so it can be stopped:

    aws ecs delete-service --cluster <cluster> --service <serviceName>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment