-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Create repo in stack A and ref it to codepipeline in stack B throws 'cyclic reference' #5727
Comments
@skinny85 I'm also encountering the same issue. Is there any workaround for this behavior until a proper fix is implemented? |
yes - there should be a simple answer to this! The cycle is because of a CloudWatch Event that is added to the repository that triggers the pipeline. If you change the source action to use polling instead: source_action = codepipeline_actions.CodeCommitSourceAction(
# rest of the properties as above...
trigger=codepipeline_actions.CodeCommitTrigger.POLL,
) this will remove the cycle. Let me know if this works! Thanks, |
Also, you can reference the repo by name, and add a manual dependency from the Pipeline stack to the stack with the repo: // App
const repositoryName = 'Repo';
const app = new App();
// CommonStack
const commonStack = new Stack(app, 'CommonStack', stackProps);
commonStack.repo = new Repository(commonStack, 'CommonCodeRepo', {repositoryName});
// PipelineStack
const pipeStack = new Stack(app, 'PipelineStack', stackProps);
pipeStack.addDependency(commonStack);
pipeStack.repo = Repository.fromRepositoryName(pipeStack, 'SourceRepo', repositoryName); |
Yes, this is excellent advice @mikestopcontinues! |
Closing for now since this looks to have been resolved. Feel free to reopen if that's not the case. |
I'd like to request that this be re-opened. If I take the OP's code and replace the direct use of the repository with |
Re-opening as per @ccurrie-amzn 's request. |
Is there any update to this one? |
Not much @teddyaryono , sorry. A PR would be very welcome if that's a possibility. |
Is this a duplicate of #3087? |
This issue has not received any attention in 1 year. If you want to keep this issue open, please leave a comment below and auto-close will be canceled. |
|
❓ General Issue
The Question
Stack A has a CodeCommit repo. I want the CodePipeline in Stack B to use this repo. This throws
Adding this dependency (cdk-repo -> cdk-pipe/CodePipeline/Resource.Ref) would create a cyclic reference.
I just had a very similar problem #5657 where I manually needed to hard code the artifact bucket. However, this time the resource mentioned in the error is hardcoded. So I am unsure if this me not understanding how this is supposed to work or if this is unexpected behavior.
Code
Here is a repo with an example of what I try to do.
app.py
repo.py
pipeline.py
Environment
Other information
The repo has to be in a different stack so it can be used by prod and dev stacks
The text was updated successfully, but these errors were encountered: