I have 2 ECS clusters in one aws account and planning to shut down 1 of the clusters, the services inside that cluster as well as stop/terminate the ec2 instances in the auto-scaling group. Is there a proper way to achieve this without leaving any traces? I have thought about the following:
- Changing number of tasks to 0 in each ECS service (cumbersome as I have 7-8 services)
- Setting Desired Count in auto scaling group to 0 (Not sure if this will stop or terminate the EC2 instances)
Any help is appreciated
2
Answers
Whenever you delete ECS cluster it will delete auto-scalling configuration, which also delete instances managed by autoscalling.
Assuming you are using AWS Cloudformation to setup the ecs cluster, you can delete the cloudformation stack, that will remove all the resources with respect to that CF stack.
Else, see if this helps – deleting via console : https://docs.aws.amazon.com/AmazonECS/latest/developerguide/delete_cluster.html