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

fix(codebuild): Rename codebuild vpc policy to a unique name #5385

Merged
merged 9 commits into from
Dec 18, 2019
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-codebuild/lib/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,7 @@ export class Project extends ProjectBase {
}));

const policy = new iam.Policy(this, 'PolicyDocument', {
policyName: 'CodeBuildEC2Policy',
policyName: this.node.uniqueId + ' CodeBuildEC2Policy',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want a space here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay if there's no space.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. You misunderstood me. There is a space there that should not be. I'm don't think you can have spaces in policy names.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes,
I understood you mean that space is in policy name.
Should I modify it like this? :
this.node.uniqueId + 'CodeBuildEC2Policy'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

statements: [
new iam.PolicyStatement({
resources: ['*'],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@
],
"Version": "2012-10-17"
},
"PolicyName": "CodeBuildEC2Policy",
"PolicyName": "awscdkcodebuildprojectvpcMyProject5C59172B CodeBuildEC2Policy",
"Roles": [
{
"Ref": "MyProjectRole9BBE5233"
Expand Down