简体   繁体   中英

AWS ECS EC2 Capacity Provider not listed

I'm trying to create a new Capacity Provider

I deployed the following CloudFormation snippet:

  myECSCapacityProvider:
      Type: AWS::ECS::CapacityProvider
      Properties:
        Name: my-project-asg-cp
        AutoScalingGroupProvider:
            AutoScalingGroupArn: !Ref myAutoScalingGroup
            ManagedScaling:
                MaximumScalingStepSize: 10
                MinimumScalingStepSize: 1
                Status: ENABLED
                TargetCapacity: 100
            ManagedTerminationProtection: DISABLED

I have the resource ASG (myAutoScalingGroup) created.

When I go to the ECS console and then to the Capacity Providers tab it is blank, no CPs are listed.

If I try to create the same CP through the console, using the name my-project-asg-cp I see the following error:

There was an error creating the capacity provider. 

Fix the following error and try again.

The specified Auto Scaling group ARN is already being used by another capacity provider. 

Specify a unique Auto Scaling group ARN and try again.

So it seems somehow the CP was created but it is not listed.

And of course, I don't have any error in CloudFormation. If I check the resources tab I can see the resource created:

myECSCapacityProvider  my-project-asg-cp  AWS::ECS::CapacityProvider  CREATE_COMPLETE   

Also, the cli doesn't show it either.

Does anyone has faced this error?

Associate the capacity provided with the cluster:

ECSCluster:
  Type: 'AWS::ECS::Cluster'
  Properties:
    ClusterName: <your-ecs-cluster>
    CapacityProviders:
      - !Ref myECSCapacityProvider

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM