CDK Pipelines: Circular dependency on initial CDK Deploy
See original GitHub issueWhat is the problem?
I am trying to deploy a pipeline using the aws-cdk/pipelines library and I am receiving a circular dependency error. I have no other resources in this stack other than the pipeline itself.
Reproduction Steps
Outer Stack:
import 'source-map-support/register';
import * as cdk from 'aws-cdk-lib';
import { SplitMonitorStackStack } from '../lib/MainPipelineStack';
const app = new cdk.App();
new SplitMonitorStackStack(app, 'SplitMonitorMainStack');
app.synth();
Inner Stack:
import { Stack, StackProps,SecretValue} from 'aws-cdk-lib';
import { Construct } from 'constructs'; // construct is in a separate package
import * as pipelines from 'aws-cdk-lib/pipelines';
export class SplitMonitorStackStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
const splitMonitoringStackPipeline = new pipelines.CodePipeline(this, "pipeline", {
pipelineName: "Split-Monitor-Main",
synth: new pipelines.ShellStep('Synth', {
input: pipelines.CodePipelineSource.gitHub('PlaceholderRepoName', "main", {
authentication: SecretValue.secretsManager('Token'),
}),
commands: [
'npm install -g aws-cdk@latest',
'npm ci',
'npm run build',
'npx cdk synth',
],
}),
crossAccountKeys: true
});
}
}
What did you expect to happen?
The pipeline and CDK deploy do be successful.
What actually happened?
SplitMonitorMainStack failed: Error [ValidationError]: Circular dependency between resources: [pipelineUpdatePipelineSelfMutation14A96D2F, pipelinePipelineBuildSynthCdkBuildProject4237770A, pipelinePipelineBuildSynthCdkBuildProjectRoleDefaultPolicyB3981181, pipelineUpdatePipelineSelfMutationRoleDefaultPolicy095404B8, pipelinePipeline4163A4B1, pipelinePipelineUpdatePipelineSelfMutateCodePipelineActionRoleDefaultPolicy09E3C254, pipelinePipelineSourceIvellaSplitMonitorStackWebhookResource4158C29A, pipelinePipelineBuildSynthCodePipelineActionRoleDefaultPolicy7B8E3FCA] at Request.extractError (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29) at Request.callListeners (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20) at Request.emit (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10) at Request.emit (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:686:14) at Request.transition (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12) at /opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:38:9) at Request.<anonymous> (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:688:12) at Request.callListeners (/opt/homebrew/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18) { code: 'ValidationError', time: 2022-01-26T18:54:30.449Z, requestId: '913f9618-4a60-483a-b8b4-aec4be38998a', statusCode: 400, retryable: false, retryDelay: 755.4424894449671 } Circular dependency between resources: [pipelineUpdatePipelineSelfMutation14A96D2F, pipelinePipelineBuildSynthCdkBuildProject4237770A, pipelinePipelineBuildSynthCdkBuildProjectRoleDefaultPolicyB3981181, pipelineUpdatePipelineSelfMutationRoleDefaultPolicy095404B8, pipelinePipeline4163A4B1, pipelinePipelineUpdatePipelineSelfMutateCodePipelineActionRoleDefaultPolicy09E3C254, pipelinePipelineSourceIvellaSplitMonitorStackWebhookResource4158C29A, pipelinePipelineBuildSynthCodePipelineActionRoleDefaultPolicy7B8E3FC
CDK CLI Version
2.9.0
Framework Version
No response
Node.js Version
v16.13.0
OS
macOS Monterey
Language
Typescript
Language Version
No response
Other information
No response
Issue Analytics
- State:
- Created 2 years ago
- Reactions:11
- Comments:10 (3 by maintainers)
Top GitHub Comments
Also seeing this issue with existing pipelines attempting to self mutate on upgrade to 2.9.0. Will revert to 2.8.0 in our pipelines…
EDIT: Pipelines reverted to 2.8.0, can confirm the issue is resolved.
im still having this issue on python a version downgrade has not resolved it. ❌ TAPP-Infrastructure-Pipeline failed: Error [ValidationError]: Circular dependency between resources: [TappPipeline03E6EFD5, TappPipelineBuildSynthCodePipelineActionRoleDefaultPolicy0692F3F9, TappPipelineBuildSynthCdkBuildProject1ABF2DA8, TappPipelineSourceterryobotdevopsWebhookResourceDFC0CED5, TappPipelineBuildSynthCdkBuildProjectRoleDefaultPolicyB7B22B1C] at Request.extractError (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/protocol/query.js:50:29) at Request.callListeners (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:106:20) at Request.emit (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:78:10) at Request.emit (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:686:14) at Request.transition (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:22:10) at AcceptorStateMachine.runTo (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:14:12) at /usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/state_machine.js:26:10 at Request.<anonymous> (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:38:9) at Request.<anonymous> (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/request.js:688:12) at Request.callListeners (/usr/local/lib/node_modules/aws-cdk/node_modules/aws-sdk/lib/sequential_executor.js:116:18) { code: ‘ValidationError’, time: 2022-02-07T10:14:20.629Z, requestId: ‘721d0849-f24a-4c6f-bf8f-d715686bb81d’, statusCode: 400, retryable: false, retryDelay: 64.29169948893887 } Circular dependency between resources: [TappPipeline03E6EFD5, TappPipelineBuildSynthCodePipelineActionRoleDefaultPolicy0692F3F9, TappPipelineBuildSynthCdkBuildProject1ABF2DA8, TappPipelineSourceterryobotdevopsWebhookResourceDFC0CED5, TappPipelineBuildSynthCdkBuildProjectRoleDefaultPolicyB7B22B1C]