Skip to content

Commit

Permalink
fix(codebuild): rename CodeBuild VPC policy to be unique (#5385)
Browse files Browse the repository at this point in the history
The policy used for the VPC permissions had the hard-coded name 'CodeBuildEc2Polocy',
which meant you could only have at most one CodeBuild project in a VPC in each stack.
The change is to use the construct's unique ID as the policy name,
which means it will be different for every project in the stack.
  • Loading branch information
eastNine authored and skinny85 committed Dec 18, 2019
1 parent 7b34d56 commit 16a1200
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 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,6 @@ export class Project extends ProjectBase {
}));

const policy = new iam.Policy(this, 'PolicyDocument', {
policyName: 'CodeBuildEC2Policy',
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": "MyProjectPolicyDocument646EE0F2",
"Roles": [
{
"Ref": "MyProjectRole9BBE5233"
Expand All @@ -424,4 +424,4 @@
}
}
}
}
}

0 comments on commit 16a1200

Please sign in to comment.