aws-cdk-lib.aws_codebuild.IBuildImage

interface IBuildImage

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

Implemented by LinuxArmBuildImage, LinuxBuildImage, LinuxGpuBuildImage, WindowsBuildImage

Obtainable from LinuxArmBuildImage.fromCodeBuildImageId(), LinuxArmBuildImage.fromEcrRepository(), LinuxBuildImage.fromAsset(), LinuxBuildImage.fromCodeBuildImageId(), LinuxBuildImage.fromDockerRegistry(), LinuxBuildImage.fromEcrRepository(), LinuxGpuBuildImage.awsDeepLearningContainersImage(), LinuxGpuBuildImage.fromEcrRepository(), WindowsBuildImage.fromAsset(), WindowsBuildImage.fromDockerRegistry(), WindowsBuildImage.fromEcrRepository()

Represents a Docker image used for the CodeBuild Project builds.

Use the concrete subclasses, either: LinuxBuildImage or WindowsBuildImage.

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.

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.

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


type

Type: string

The type of build environment.


imagePullPrincipalType?

Type: ImagePullPrincipalType (optional, default: ImagePullPrincipalType.SERVICE_ROLE)

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


repository?

Type: IRepository (optional, default: no repository)

An optional ECR repository that the image is hosted in.


secretsManagerCredentials?

Type: ISecret (optional, default: no credentials will be used)

The secretsManagerCredentials for access to a private registry.

Methods

NameDescription
runScriptBuildspec(entrypoint)Make a buildspec to run the indicated script.
validate(buildEnvironment)Allows the image a chance to validate whether the passed configuration is correct.

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 — the current build environment.

Returns

  • string[]

Allows the image a chance to validate whether the passed configuration is correct.