Skip to content

[aws-codebuild] Provide the ability to explicitly set BuildEnvironment type  #9817

@jimistry123

Description

@jimistry123

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    @aws-cdk/aws-codebuildRelated to AWS CodeBuildeffort/smallSmall work item – less than a day of effortfeature-requestA feature should be added or improved.p1

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions