Skip to content

Conversation

pahud
Copy link
Contributor

@pahud pahud commented Aug 12, 2025

Document ECS cross-stack capacity provider limitation

Issue # (if applicable)

Closes #35210.

Reason for this change

Users encounter circular dependency errors when trying to add ECS capacity providers from different stacks. The AWS CDK framework automatically creates bidirectional dependencies in cross-stack scenarios:

  1. Forward Dependency: ClusterStackCapacityStack (cluster needs capacity provider reference)
  2. Reverse Dependency: CapacityStackClusterStack (capacity provider instances need cluster configuration)

This creates a circular dependency that CloudFormation cannot resolve. The current documentation does not clearly communicate this limitation, leading to user confusion.

Description of changes

Added clear documentation notes in the ECS README to communicate that cross-stack ECS capacity provider registration is not supported by the CDK framework:

  • Added a note in the main Capacity Providers section referencing the limitation
  • Added a detailed note in the Auto Scaling Group Capacity Providers section explaining the constraint
  • Provides clear guidance to deploy clusters and capacity providers in the same stack

This is a documentation-only change that clarifies existing behavior rather than introducing new functionality or breaking changes.

Describe any new or updated permissions being added

No new or updated IAM permissions are needed - this is a documentation-only change.

Description of how you validated changes

  • Verified the documentation renders correctly in markdown
  • Confirmed no code changes were made that could affect functionality
  • Existing tests continue to pass unchanged

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

…viders

must be created in the same stack to avoid circular dependency issues.
@github-actions github-actions bot added bug This issue is a bug. effort/medium Medium work item – several days of effort p2 labels Aug 12, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team August 12, 2025 12:22
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Aug 12, 2025
@pahud pahud marked this pull request as ready for review August 12, 2025 12:25
@leonmk-aws leonmk-aws self-assigned this Sep 8, 2025
Copy link
Contributor

mergify bot commented Sep 8, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

Copy link
Contributor

mergify bot commented Sep 8, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 6cc426e into aws:main Sep 8, 2025
19 checks passed
Copy link
Contributor

github-actions bot commented Sep 8, 2025

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. contribution/core This is a PR that came from AWS. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws-ecs: circular dependency between ecs.Cluster and autoscaling.AutoScalingGroup
2 participants