Skip to content
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

codebuild.Project.addToRoleInlinePolicy should allow you to specify the policyName #2845

Closed
corymhall opened this issue Jun 12, 2019 · 3 comments
Labels
feature-request A feature should be added or improved.

Comments

@corymhall
Copy link
Contributor

Currently there are two ways to attach an IAM policy to the default IAM role that is created with the codebuild project.

  1. addToRolePolicy - Adds the provided policy statement to the default inline policy created with the role.
  2. addToRoleInlinePolicy - Creates a new inline policy with the hardcoded name CodeBuildEC2Policy and adds the provided policy statement.

It would be great if the addToRoleInlinePolicy method allowed you to specify the policyName so that we could create as many inline policies as we want.

@corymhall corymhall added the feature-request A feature should be added or improved. label Jun 12, 2019
@corymhall
Copy link
Contributor Author

I was going to create a pull request to add this functionality, but I noticed there is already a pull request that is updating that method #2662. Can this be addressed in that pull request, or should I wait until that is implemented and create a separate PR?

@skinny85
Copy link
Contributor

Hey @corymhall ,

thanks for opening the issue. The method addToRoleInlinePolicy was exposed accidentally on Project. The intention of it was to keep it private, and that's what the PR #2662 will do. If you need that functionality, you should call it directly on the IRole Project exposes: project.role.attachInlinePolicy(new iam.Policy(...)).

Thanks,
Adam

@corymhall
Copy link
Contributor Author

ah that makes sense. Thanks for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

2 participants