Skip to content

(software.amazon.awscdk.services.codebuild): CodeBuild ARM (aarch64) images/architecture is not fully supported by CDK #18916

@tmmvn

Description

@tmmvn

What is the problem?

CodeBuild module does not support using arch 64 images due to missing ComputeType enum options. You can observe the aarch64 compute options are different than the default linux options in the console, but there doesn't seem to be a way to set to one in CDK.

Reproduction Steps

Create a CodeBuild project in a stack like this:

Repository repo = Repository.Builder.create(this, "Repository")
          .description("description")
          .repositoryName("repositoryName")
          .build();
CodeCommitSourceProps props = CodeCommitSourceProps.builder()
          .branchOrRef("dev")
          .repository(repo)
          .build();
ISource source = Source.codeCommit(props);
BuildEnvironment env = BuildEnvironment.builder()
          .buildImage(LinuxBuildImage.fromCodeBuildImageId("aws/codebuild/amazonlinux2-aarch64-standard:2.0"))
          .computeType(ComputeType.MEDIUM) // NOTE: No ComputeType will deploy successfully
          .build();
Project buildProject = Project.Builder.create(this, "BuildProject")
          .description("description")
          .environment(env)
          .projectName("projectName")
          .source(source)
          .build();

What did you expect to happen?

Stack deploys successfully.

What actually happened?

AWS CodeBuild curated image aws/codebuild/amazonlinux2-aarch64-standard:2.0 is not supported for projects with environment type LINUX_CONTAINER and compute type BUILD_GENERAL1_SMALL (Service: AWSCodeBuild; Status Code: 400; Error Code: InvalidInputException; Request ID: fce423e8-0d42-472e-9733-816b8055778c; Proxy: null)

CDK CLI Version

2.12.0 (build c9786db)

Framework Version

No response

Node.js Version

v16.10.0

OS

MacOS 12.2

Language

Java

Language Version

Java (8)

Other information

Even when omitting the compute type, the default value prevents deployment.

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.feature/coverage-gapGaps in CloudFormation coverage by L2 constructsp2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions