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?

posta 4 mesi fa425 visualizzazioni
2 Risposte
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.

con risposta 4 mesi fa
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.

con risposta 4 mesi fa
  • 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.

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande