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

AWS
已提問 1 年前檢視次數 639 次
1 個回答
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
專家
已回答 1 年前
profile picture
專家
已審閱 1 年前
  • Is there any way to make ecs cluster be deleted by cloudformation, not other additional cli?

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南