-
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
fix(pipelines): specifying the Action Role for CodeBuild steps #18293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be two different roles. Please add a separate configuration field.
But this actually doesn't seem like the right fix. Can we look at the Maximum policy size of 10240 bytes exceeded
error a little closer ?
How many roles do we have in there? Why is the policy so large?
I can change it to a The Scenario would be having a pipeline which deploys to multiple stages and each stage a code build action to do a test or change. |
@tobytipton if you are going to introduce a new property, you will need to either make that property default to using this.props.role, or else specify that property here (and possibly other places): aws-cdk/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts Lines 677 to 687 in 7294118
@rix0rrr As a note, it does seem that the intention, in at least the following case, is for them to be the same (note that this comment expresses the desired behavior, but is not actually what is currently happening): aws-cdk/packages/@aws-cdk/pipelines/lib/codepipeline/codepipeline.ts Lines 807 to 812 in 7294118
Regardless, a fix to this is desperately needed as, currently, the pipelines module can quickly become unusable (e.g. if you have a lot of Lambda functions with associated Code assets) since there does not seem to be a way to override this behavior. |
Is this change still necessary after #19114 ? |
@rix0rrr yes, but less often. If you have enough assets, you can still get too big of a policy document from having so many roles that the pipeline role needs to be able to assume. However, with #19114 those roles are all listed in a single policy statement rather than many, so the number of assets needed to hit the limit is now a lot larger, but I believe I hit the limit when I tried something similar to #19114 with about 150 or so assets. |
Thanks for checking. I'm planning on implementing the feature flag for #19114 today or tomorrow and then attempting to test this weekend. I'll update this ticket with my findings. I wanted to wait a few days. |
Yes, this change is still required. I deployed a stack using 1.150.0 with the iam minimize feature flag and still get errors regarding policy size exceeding 10240 bytes. Additionally, the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* | ||
* @default - A role is automatically created | ||
*/ | ||
readonly buildActionRole?: iam.IRole; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rename this to actionRole
.
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from master and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
This fix should address the issue #18291
fixes #18291
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license