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 個月前檢視次數 424 次
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.

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

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

回答問題指南