Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to delete EC2 instance for ECS(EC2 Container Service)

As Amazon ECS being launched recently, I tried to start a sample with it. It looks like ECS will create a EC2 instance as a "cluster" for ECS, whose name is like "ECS Instance - EC2ContainerService-default-e40c3e79-1d27-4512-a790-c6782b45b15a". However, I cannot find a way to delete this EC2 instance when I don't want to serve my container any more.

When I terminate this instance through web console, another instance with the same name(but different instance id) will show up later. It's quite annoying and has already charged my some money. Here's the screenshot of EC2 web console:

screenshot of EC2 web console

where there's always a running instance.

Here's my screenshot of ECS web console, where I have deleted all the cluster.

enter image description here enter image description here

At this point, I can't find any documentation or blog on this issue. :(

like image 961
eval Avatar asked Dec 10 '22 21:12

eval


1 Answers

Note

If your instance is maintained by an Auto Scaling group or AWS CloudFormation stack, terminate the instance by updating the Auto Scaling group or AWS CloudFormation stack; otherwise, the Auto Scaling group will recreate the instance after you terminate it.

http://docs.aws.amazon.com/AmazonECS/latest/developerguide/deregister_container_instance.html

Auto Scaling groups can be found in the the EC2 console navigation pane: under Auto Scaling, click Auto Scaling Group.

like image 188
Michael - sqlbot Avatar answered Jan 04 '23 15:01

Michael - sqlbot