-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(aws-ecs): Can't enable both Fargate and ASG capacity providers #14730
Comments
The issue here is that we are specifying the FARGATE and FARGATE_SPOT capacity providers as a member of the Cluster resource, but creating ClusterCapacityProviderAssociations for the ASG capacity providers. In order for this to work with cloudformation, all of the capacity providers need to be specified either in the Cluster.CapacityProviders field OR on the ClusterCapacityProviderAssocitations.CapacityProvider field. Since specifying an ASG Capacity Provider in CFN requires specifying the latter in order to avoid a circular dependency issue, we need to change the Fargate CPs to also create a ClusterCPAssociation. Working on a fix! |
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730.
… Cluster (#15012) Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes #14730. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
… Cluster (aws#15012) Previously, adding/enabling Fargate capacity providers would add the FARGATE and FARGATE_SPOT capacity providers a part of the [capacityProviders field](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-cluster.html#cfn-ecs-cluster-capacityproviders) on the ECS::Cluster resource. However, ASG Capacity Providers can only be specified as part of the [capacityProviders field on the ECS::ClusterCapacityProviderAssociation](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ecs-clustercapacityproviderassociations.html#cfn-ecs-clustercapacityproviderassociations-capacityproviders) resource, due to circular dependency issues. However, when a cluster is created, any capacity providers regardless of type must all be specified *either* on the cluster *or* as a ClusterCapacityProviderAssociation. Therefore, in order to support both types on the same cluster, Fargate capacity providers must also be specified as a ClusterCapacityProviderAssociation. This change removes the Fargate capacity providers from the Cluster resource and adds them as a ClusterCapacityProviderAssociation. Fixes aws#14730. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
According to the ECS Cluster Capacity Providers docs it should be possible to have both Fargate and ASG powered capacity providers associated with a ECS cluster.
This seem to not be the case with CDK. Cloudformation fails with a "The cluster already contains capacity provider associations" message when trying to provision a cluster that have both
enableFargateCapacityProviders
set totrue
and an ASG provided throughaddAsgCapacityProvider(...)
.Reproduction Steps
What did you expect to happen?
The CF stack to finish successfully and for the cluster to be associated with both Fargate and ASG capacity providers, thus allowing for a service to decide if it should run on EC2 or Fargate, in the same ECS cluster.
What actually happened?
Environment
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: