Skip to content

Instantly share code, notes, and snippets.

@dasgoll
Created October 17, 2015 08:59
Show Gist options
  • Save dasgoll/0499e785a5ae068b6659 to your computer and use it in GitHub Desktop.
Save dasgoll/0499e785a5ae068b6659 to your computer and use it in GitHub Desktop.
Delete AWS ECS cluster - The service cannot be stopped while the primary deployment is scaled above 0
I tried to delete a cluster:
"The Cluster cannot be deleted while Services are active."
I tried to delete the service called 'nginx':
"The service cannot be stopped while the primary deployment is scaled above 0"
Select service, click 'Update' - set 'Number of tasks' to 0
This changed the number of 'Desired Tasks' to 0
Or I guess:
aws ecs update-service --service nginx --desired-count 0 --cluster ecscluster1 --profile devops
Delete the service
Delete the cluster
@osadan
Copy link

osadan commented Jul 11, 2017

tnx.

@Amitpandey03
Copy link

Please follow the below steps:

  1. Click on Update
  2. Make Number of Tasks to 0
  3. Update the service again
  4. Then click on Delete

@djones
Copy link

djones commented Nov 14, 2017

Thanks

Copy link

ghost commented Jan 8, 2018

Thanks Amitpandey. It help for me too...

@davidalencar
Copy link

Thanks =)

@tmurvv
Copy link

tmurvv commented Feb 18, 2023

Big help five years later :)

@dennismasinde
Copy link

Works!!!

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