File tree 2 files changed +7
-4
lines changed
packages/@aws-cdk/aws-codebuild
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -903,9 +903,9 @@ export class Project extends ProjectBase {
903
903
this . addToRolePolicy ( new iam . PolicyStatement ( )
904
904
. addResource ( `arn:aws:ec2:${ Aws . region } :${ Aws . accountId } :network-interface/*` )
905
905
. addCondition ( 'StringEquals' , {
906
- "ec2:Subnet" : [
907
- `arn:aws:ec2: ${ Aws . region } : ${ Aws . accountId } :subnet/[[subnets]]`
908
- ] ,
906
+ "ec2:Subnet" : props . vpc
907
+ . selectSubnets ( props . subnetSelection ) . subnetIds
908
+ . map ( si => `arn:aws:ec2: ${ Aws . region } : ${ Aws . accountId } :subnet/ ${ si } ` ) ,
909
909
"ec2:AuthorizedService" : "codebuild.amazonaws.com"
910
910
} )
911
911
. addAction ( 'ec2:CreateNetworkInterfacePermission' ) ) ;
Original file line number Diff line number Diff line change 312
312
{
313
313
"Ref" : " AWS::AccountId"
314
314
},
315
- " :subnet/[[subnets]]"
315
+ " :subnet/" ,
316
+ {
317
+ "Ref" : " MyVPCPrivateSubnet1Subnet641543F4"
318
+ }
316
319
]
317
320
]
318
321
}
You can’t perform that action at this time.
0 commit comments