[codebuild] Codebuild Project in VPC creates policy incompatible with GovCloud #10634
Labels
@aws-cdk/aws-codebuild
Related to AWS CodeBuild
bug
This issue is a bug.
in-progress
This issue is being actively worked on.
needs-triage
This issue or PR still needs to be triaged.
Reproduction Steps
When attempting to create a CodeBuild project within a VPC in a GovCloud account, the DefaultPolicy attached to CodeBuild IAM Role uses a resource reference with
arn:aws:ec2:...
instead ofarn:${Aws.PARTITION}:ec2:...
e.g.:
What did you expect to happen?
A policy should have been added for resource
"arn:aws:ec2:us-gov-west-1:[ACCOUNT_NUMBER]:network-interface/*"
. Regionus-gov-west-1
is pulled from env, as should Partitionaws-gov
.What actually happened?
Aws.PARTITION
is not sourced, instead:aws:
is used as the partition when constructing the urlCan be seen here
Environment
Other
Simple Fix
Opening a PR for this, but just need to inject
${Aws.PARTITION}
in place ofaws
in constructed arn in the codebuild/lib/project.ts package linked above.This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: