stacks form dependency cycle
cdk-stack-dependency-cycle-fixSend the CDK cyclic reference error and the resource types of the two construct paths it names. Identifies which edge was added silently by a grant, an origin access control or a bucket notification, explains why, and returns replacement CDK code in TypeScript or Python that keeps the access but removes the back reference. Covers CloudFront OAC with a bucket in another stack, grants into KMS, S3, Secrets Manager, SQS, SNS and ECR policies, and S3 notifications. Use when the error reads: '' depends on '' (...). Adding this dependency (...) would create a cyclic reference | cyclic reference between stacks at cdk synth. Covers: Two stack cycles reported by CDK synth where the error names both construct paths and their resource types are supplied. Three or more stack cycles and nested stack cycles are not covered. Price: 5.00 USDC on Base via x402, charged only when the case is solved.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"error_message": "<error_message>",
"resources": "<resources>"
},
"name": "cdk-stack-dependency-cycle-fix"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| resources | Yes | CloudFormation type of each construct path named in the error, keyed by path without the attribute, for example {"DataStack/Bucket/Resource":"AWS::S3::Bucket","WebStack/Distribution/Resource":"AWS::CloudFront::Distribution"}. | |
| cdk_language | No | ||
| error_message | Yes | The full CDK error line containing 'would create a cyclic reference'. | |
| uses_customer_kms_key | No | True when the bucket, secret, queue or topic in the cycle is encrypted with a customer managed KMS key. |