-
Notifications
You must be signed in to change notification settings - Fork 4.5k
[aws-codebuild] Provide the ability to explicitly set BuildEnvironment type #9817
Description
When building artifacts using ARM architecture, it would be nice to be able to specify the type of the build environment when CodeBuild is not able to directly infer the architecture from the build image. Especially this is the case when using a custom image instead of a default image.
Use Case
I am using a custom Docker image that is built from base ARM image LinuxBuildImage.AMAZON_LINUX_2_ARM. And when I create a CodeBuild project using this custom image, it configures the Environment.Type property to LINUX_CONTAINER instead of ARM_CONTAINER.
Proposed Solution
To workaround this issue, I have to use an escape hatch to modify CloudFormation resource behind CodeBuildProject like this:
CfnProject cfnProject = (CfnProject) createBuildProject().getNode().getDefaultChild();
if (cfnProject != null) {
cfnProject.addPropertyOverride("Environment.Type", "ARM_CONTAINER");
}So it would be nice if there was a type method in BuildEnvironment.Builder class that allows setting the type to LINUX_CONTAINER or ARM_CONTAINER.
This is a 🚀 Feature Request