LinuxArmBuildImage

class aws_cdk.aws_codebuild.LinuxArmBuildImage(*args: Any, **kwargs)

Bases: object

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])

  • LinuxBuildImage.fromDockerRegistry(image[, { secretsManagerCredentials }])

See:

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

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codebuild as codebuild

linux_arm_build_image = codebuild.LinuxArmBuildImage.from_code_build_image_id("id")

Methods

run_script_buildspec(entrypoint)

Make a buildspec to run the indicated script.

Parameters:

entrypoint (str) –

Return type:

BuildSpec

validate(*, build_image=None, certificate=None, compute_type=None, environment_variables=None, privileged=None)

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

Parameters:
  • build_image (Optional[IBuildImage]) – The image used for the builds. Default: LinuxBuildImage.STANDARD_1_0

  • certificate (Union[BuildEnvironmentCertificate, Dict[str, Any], None]) – The location of the PEM-encoded certificate for the build project. Default: - No external certificate is added to the project

  • compute_type (Optional[ComputeType]) – The type of compute to use for this build. See the ComputeType enum for the possible values. Default: taken from #buildImage#defaultComputeType

  • environment_variables (Optional[Mapping[str, Union[BuildEnvironmentVariable, Dict[str, Any]]]]) – The environment variables that your builds can use.

  • privileged (Optional[bool]) – Indicates how the project builds Docker images. Specify true to enable running the Docker daemon inside a Docker container. This value must be set to true only if this build project will be used to build Docker images, and the specified build environment image is not one provided by AWS CodeBuild with Docker support. Otherwise, all associated builds that attempt to interact with the Docker daemon will fail. Default: false

Return type:

List[str]

Attributes

AMAZON_LINUX_2_STANDARD_1_0 = <aws_cdk.aws_codebuild.LinuxArmBuildImage object>
AMAZON_LINUX_2_STANDARD_2_0 = <aws_cdk.aws_codebuild.LinuxArmBuildImage object>
AMAZON_LINUX_2_STANDARD_3_0 = <aws_cdk.aws_codebuild.LinuxArmBuildImage object>
default_compute_type

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

image_id

The Docker image identifier that the build environment uses.

image_pull_principal_type

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

repository

An optional ECR repository that the image is hosted in.

secrets_manager_credentials

The secretsManagerCredentials for access to a private registry.

type

The type of build environment.

Static Methods

classmethod from_code_build_image_id(id)

Uses a Docker image provided by CodeBuild.

Parameters:

id (str) – The image identifier.

Return type:

IBuildImage

Returns:

A Docker image provided by CodeBuild.

See:

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

Example:

"aws/codebuild/amazonlinux2-aarch64-standard:1.0"
classmethod from_docker_registry(name, *, secrets_manager_credentials=None)
Parameters:
  • name (str) –

  • secrets_manager_credentials (Optional[ISecret]) – The credentials, stored in Secrets Manager, used for accessing the repository holding the image, if the repository is private. Default: no credentials will be used (we assume the repository is public)

Return type:

IBuildImage

Returns:

a x86-64 Linux build image from a Docker Hub image.

classmethod from_ecr_repository(repository, tag_or_digest=None)

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.

Parameters:
  • repository (IRepository) – The ECR repository.

  • tag_or_digest (Optional[str]) – Image tag or digest (default “latest”, digests must start with sha256:).

Return type:

IBuildImage

Returns:

An aarch64 Linux build image from an ECR repository.

See:

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