aws-cdk-lib.aws_codebuild.LinuxArmBuildImage

class LinuxArmBuildImage

LanguageType name
.NETAmazon.CDK.AWS.CodeBuild.LinuxArmBuildImage
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodebuild#LinuxArmBuildImage
Javasoftware.amazon.awscdk.services.codebuild.LinuxArmBuildImage
Pythonaws_cdk.aws_codebuild.LinuxArmBuildImage
TypeScript (source)aws-cdk-lib » aws_codebuild » LinuxArmBuildImage

Implements IBuildImage

A CodeBuild image running aarch64 Linux.

This class has a bunch of public constants that represent the CodeBuild ARM images.

You can also specify a custom image using the static method:

  • LinuxBuildImage.fromEcrRepository(repo[, tag])

See also: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
const linuxArmBuildImage = codebuild.LinuxArmBuildImage.AMAZON_LINUX_2_STANDARD_1_0;

Properties

NameTypeDescription
defaultComputeTypeComputeTypeThe default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.
imageIdstringThe Docker image identifier that the build environment uses.
typestringThe type of build environment.
imagePullPrincipalType?ImagePullPrincipalTypeThe type of principal that CodeBuild will use to pull this build Docker image.
repository?IRepositoryAn optional ECR repository that the image is hosted in.
secretsManagerCredentials?ISecretThe secretsManagerCredentials for access to a private registry.
static AMAZON_LINUX_2_STANDARD_1_0IBuildImageImage "aws/codebuild/amazonlinux2-aarch64-standard:1.0".
static AMAZON_LINUX_2_STANDARD_2_0IBuildImageImage "aws/codebuild/amazonlinux2-aarch64-standard:2.0".
static AMAZON_LINUX_2_STANDARD_3_0IBuildImageImage "aws/codebuild/amazonlinux2-aarch64-standard:3.0".

defaultComputeType

Type: ComputeType

The default ComputeType to use with this image, if one was not specified in BuildEnvironment#computeType explicitly.


imageId

Type: string

The Docker image identifier that the build environment uses.


type

Type: string

The type of build environment.


imagePullPrincipalType?

Type: ImagePullPrincipalType (optional)

The type of principal that CodeBuild will use to pull this build Docker image.


repository?

Type: IRepository (optional)

An optional ECR repository that the image is hosted in.


secretsManagerCredentials?

Type: ISecret (optional)

The secretsManagerCredentials for access to a private registry.


static AMAZON_LINUX_2_STANDARD_1_0

Type: IBuildImage

Image "aws/codebuild/amazonlinux2-aarch64-standard:1.0".


static AMAZON_LINUX_2_STANDARD_2_0

Type: IBuildImage

Image "aws/codebuild/amazonlinux2-aarch64-standard:2.0".


static AMAZON_LINUX_2_STANDARD_3_0

Type: IBuildImage

Image "aws/codebuild/amazonlinux2-aarch64-standard:3.0".

Methods

NameDescription
runScriptBuildspec(entrypoint)Make a buildspec to run the indicated script.
validate(buildEnvironment)Validates by checking the BuildEnvironment computeType as aarch64 images only support ComputeType.SMALL and ComputeType.LARGE.
static fromCodeBuildImageId(id)Uses a Docker image provided by CodeBuild.
static fromEcrRepository(repository, tagOrDigest?)Returns an ARM image running Linux from an ECR repository.

runScriptBuildspec(entrypoint)

public runScriptBuildspec(entrypoint: string): BuildSpec

Parameters

  • entrypoint string

Returns

  • BuildSpec

Make a buildspec to run the indicated script.


validate(buildEnvironment)

public validate(buildEnvironment: BuildEnvironment): string[]

Parameters

  • buildEnvironment BuildEnvironment — BuildEnvironment.

Returns

  • string[]

Validates by checking the BuildEnvironment computeType as aarch64 images only support ComputeType.SMALL and ComputeType.LARGE.


static fromCodeBuildImageId(id)

public static fromCodeBuildImageId(id: string): IBuildImage

Parameters

  • id string — The image identifier.

Returns

  • IBuildImage

Uses a Docker image provided by CodeBuild.

See also: https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-available.html Example

'aws/codebuild/amazonlinux2-aarch64-standard:1.0'

static fromEcrRepository(repository, tagOrDigest?)

public static fromEcrRepository(repository: IRepository, tagOrDigest?: string): IBuildImage

Parameters

  • repository IRepository — The ECR repository.
  • tagOrDigest string — Image tag or digest (default "latest", digests must start with sha256:).

Returns

  • IBuildImage

Returns an ARM image running Linux from an ECR repository.

NOTE: if the repository is external (i.e. imported), then we won't be able to add a resource policy statement for it so CodeBuild can pull the image.

See also: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-ecr.html