From 53d3b1ff435398b202b2970b32509a7632389d13 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 12 Aug 2025 08:19:53 -0400 Subject: [PATCH 1/3] Add documentation to clarify that ECS clusters and their capacity providers must be created in the same stack to avoid circular dependency issues. --- packages/aws-cdk-lib/aws-ecs/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index cae8cbb27c494..743bc2b1d8d46 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -1544,6 +1544,8 @@ Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-cap Group](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html) Capacity Providers. Both are supported. +> **Note**: ECS clusters and their capacity providers must be deployed in the same CDK stack. Cross-stack capacity provider registration is not supported due to circular dependency constraints. See the [Auto Scaling Group Capacity Providers](#auto-scaling-group-capacity-providers) section for more details. + ### Fargate Capacity Providers To enable Fargate capacity providers, you can either set @@ -1591,6 +1593,8 @@ it in the constructor. Then add the Capacity Provider to the cluster. Finally, you can refer to the Provider by its name in your service's or task's Capacity Provider strategy. +> **Note**: Cross-stack capacity provider registration is not supported. The ECS cluster and its capacity providers must be created in the same stack to avoid circular dependency issues. + By default, Auto Scaling Group Capacity Providers will manage the scale-in and scale-out behavior of the auto scaling group based on the load your tasks put on the cluster, this is called [Managed Scaling](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html#asg-capacity-providers-managed-scaling). If you'd From eb94f7a406828008f887644f5efb5e3f1d51a8c0 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 12 Aug 2025 08:23:17 -0400 Subject: [PATCH 2/3] minor --- packages/aws-cdk-lib/aws-ecs/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 743bc2b1d8d46..4b296bce8b9dd 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -1544,7 +1544,7 @@ Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-cap Group](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html) Capacity Providers. Both are supported. -> **Note**: ECS clusters and their capacity providers must be deployed in the same CDK stack. Cross-stack capacity provider registration is not supported due to circular dependency constraints. See the [Auto Scaling Group Capacity Providers](#auto-scaling-group-capacity-providers) section for more details. +> **Note**: ECS clusters and their capacity providers must be deployed in the same CDK stack. Cross-stack capacity provider registration is not supported due to circular dependency constraints. ### Fargate Capacity Providers From ea17fa58da457fc4898193ee64a8f7f07fe8a295 Mon Sep 17 00:00:00 2001 From: Pahud Hsieh Date: Tue, 12 Aug 2025 08:24:53 -0400 Subject: [PATCH 3/3] minor --- packages/aws-cdk-lib/aws-ecs/README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/aws-cdk-lib/aws-ecs/README.md b/packages/aws-cdk-lib/aws-ecs/README.md index 4b296bce8b9dd..f03f73e8eb865 100644 --- a/packages/aws-cdk-lib/aws-ecs/README.md +++ b/packages/aws-cdk-lib/aws-ecs/README.md @@ -1544,8 +1544,6 @@ Fargate](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/fargate-cap Group](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html) Capacity Providers. Both are supported. -> **Note**: ECS clusters and their capacity providers must be deployed in the same CDK stack. Cross-stack capacity provider registration is not supported due to circular dependency constraints. - ### Fargate Capacity Providers To enable Fargate capacity providers, you can either set