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?

preguntada hace 4 meses423 visualizaciones
2 Respuestas
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.

respondido hace 4 meses
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.

respondido hace 4 meses
  • 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.

No has iniciado sesión. Iniciar sesión para publicar una respuesta.

Una buena respuesta responde claramente a la pregunta, proporciona comentarios constructivos y fomenta el crecimiento profesional en la persona que hace la pregunta.

Pautas para responder preguntas