Delete cloudformation stack failed due to ECS cluster cannot be deleted

0

Hello All,

We use cloudformation to create ECS cluster, but it is always failed when we try to delete cloudformation stack due to ECS cluster cannot be deleted successfully. The error message as below: Resource handler returned message: "Error occurred during operation 'DeleteClusters SDK Error: The Cluster cannot be deleted while Container Instances are active or draining. (Service: AmazonECS; Status Code: 400; Error Code: ClusterContainsContainerInstancesException; Request ID: ecea3cfb-38b7-4d1a-8af5-a11e22999428; Proxy: null)'." (RequestToken: deb1c362-8ee2-7734-28a2-bb306f9f31f3, HandlerErrorCode: GeneralServiceException)

According to error message, the failure reason is "Container Instances are active or draining", so ECS cluster cannot be deleted.

Is there any way to make cloudformation stack can be deleted successfully, for example: force to delete ECS cluster or wait for ECS cluster deleted.

Thanks, Mingtong

1 Respuesta
0

Hi mingtong,

please consider looking at this guide: https://repost.aws/knowledge-center/ecs-cluster-delete-failure-stack

You may need to delete or stop associated resources. Hope it helps ;)

profile picture
EXPERTO
respondido hace un año
profile picture
EXPERTO
revisado hace un año
  • Is there any way to make ecs cluster be deleted by cloudformation, not other additional cli?

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas