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 réponse
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
EXPERT
répondu il y a un an
profile picture
EXPERT
vérifié il y a un an
  • Is there any way to make ecs cluster be deleted by cloudformation, not other additional cli?

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions