How can I find out if a capacity provider is associated to an ECS cluster?

0

I have created an auto scaling group capacity provider The capacity provider appears in the result of AWS CLI ecs describe-capacity-providers command. And if I try to delete the capacity provider using AWS CLI ecs delete-capacity-provider the operation fails with the following reason.

"updateStatus": "DELETE_FAILED", "updateStatusReason": "The capacity provider cannot be deleted because it is associated with cluster: my-cluster. Remove the capacity provider from the cluster and try again."

However, I don't see anything about the capacity provider I am trying delete when seeing the cluster information from AWS CLI ecs describe-clusters.

Can a capacity provider not be listed as a cluster's capacity provider and still be associated with it? Is there another way to confirm an association between a capacity provider and a cluster?

質問済み 4ヶ月前425ビュー
2回答
1

The capacity provider was created with Terraform. I don't know how the association was made and not visible in any way. But after the following AWS CLI command, the association became explicit and visible from the management console and from the AWS CLI.

aws ecs put-cluster-capacity-providers \
     --cluster ecs-cluster-ffl \
     --capacity-providers  FARGATE FARGATE_SPOT my-provider \
     --default-capacity-provider-strategy capacityProvider=FARGATE

Similar attempts did not work before as I did not have FARGATE and FARGATE_SPOT in capacity providers list. My understanding is that the operation failed then because since FARGATE was not specified in capacity providers list and was trying to remove FARGATE capacity provider which was being used.

回答済み 4ヶ月前
0

According to the documentation https://docs.aws.amazon.com/AmazonECS/latest/developerguide/cluster-capacity-providers.html, A capacity provider must be associated with a cluster before being specified in a capacity provider strategy. If the cluster deletion fails with the error "updateStatus": "DELETE_FAILED", "updateStatusReason": "The capacity provider cannot be deleted because it is associated with cluster: my-cluster". Remove the capacity provider from the cluster and try again." Please delete the capacity provider under the "Capacity Providers" tab of the cluster.

回答済み 4ヶ月前
  • Yes I was aware of that. However, the problem was that I wasn't able to see my capacity provider from from the cluster's 'Infrastructure' tab where the list of 'Capacity Providers' in the management console from my web browser nor the output of AWS CLI querying about ecs cluster.

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ