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
@dennismasinde
Copy link

Works!!!

@djsd123
Copy link

djsd123 commented Sep 5, 2024

Much appreciated 🙏

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