Why is the Amazon ECS container instance that I terminated still registered with its cluster?

Last updated: 2019-04-18

I terminated my container instance in Amazon Elastic Container Service (Amazon ECS), but my container instance still appears as a resource in my Amazon ECS cluster. How can I remove this container instance from my cluster?

Short Description

If you terminate a container instance in the RUNNING state, that container instance is automatically removed, or deregistered, from the cluster. However, if you terminate a container instance in the STOPPED state, that container instance isn't automatically removed from the cluster.

Resolution

Deregister your container instance in the STOPPED state by using the Amazon ECS console or AWS Command Line Interface.

The deregistered container instance will no longer appear as a resource in your Amazon ECS cluster.