-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Using imported code build project for CodeBuildAction results in "resource imported without a role" #4613
Comments
Hey @Stompf , thanks for opening the issue. I was able to reproduce it locally, unfortunately the problem (in my opinion) is in the guts of the IAM library, and how it deals with unknown principals. It won't be an easy fix, I'm afraid :(. I'm not even sure how to unblock you here... can you find out what Sorry I don't have better news here :(. Thanks, |
Actually, scratch that. I think I might have an idea for an easy fix. Stay tuned. |
Because of the way the IAM library was used in the CodeBuild CodePipeline action, it was not possible to provide an imported project to the action (it would result in an error being thrown from the IAM library for the KMS key permissions). Fixes aws#4613
I'm trying to use an imported code build project in a CodeBuildAction imported from @aws-cdk/aws-codepipeline-actions but it results in an error: "Cannot get policy fragment of Stack/CodeBuild, resource imported without a role". My use case is that I want to use a code build in a different AWS account in my code pipeline with a cross account role.
Reproduction Steps
I have a cross account role like this:
this role is used for my CodeBuildAction in my pipeline:
Now when running
cdk synth
i get the error.Error Log
Environment
Other
It looks like the problem is it tries to attach bucket policies to the
UnknownPrincipal
. If I uncommentoptions.bucket.grantRead(this.props.project);
in/node_modules/@aws-cdk/aws-codepipeline-actions/lib/codebuild/build-action.js
the cloud formation is generated with no problems and after deploying it the pipeline works. Is there a way to get around this issue without chaining the source files?This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: