WindowsBuildImage

class aws_cdk.aws_codebuild.WindowsBuildImage(*args, **kwargs)

Bases: object

A CodeBuild image running Windows.

This class has a bunch of public constants that represent the most popular images.

You can also specify a custom image using one of the static methods:

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

  • WindowsBuildImage.fromEcrRepository(repo[, tag, imageType])

  • WindowsBuildImage.fromAsset(parent, id, props, [, imageType])

See

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

Methods

run_script_buildspec(entrypoint)

Make a buildspec to run the indicated script.

Parameters

entrypoint (str) –

Return type

BuildSpec

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

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

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

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

  • environment_variables (Optional[Mapping[str, BuildEnvironmentVariable]]) – 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

WINDOWS_BASE_2_0 = <aws_cdk.aws_codebuild.WindowsBuildImage object>
WIN_SERVER_CORE_2016_BASE = <aws_cdk.aws_codebuild.WindowsBuildImage object>
WIN_SERVER_CORE_2019_BASE = <aws_cdk.aws_codebuild.WindowsBuildImage object>
default_compute_type

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

Return type

ComputeType

image_id

The Docker image identifier that the build environment uses.

Return type

str

image_pull_principal_type

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

Return type

Optional[ImagePullPrincipalType]

repository

An optional ECR repository that the image is hosted in.

Return type

Optional[IRepository]

secrets_manager_credentials

The secretsManagerCredentials for access to a private registry.

Return type

Optional[ISecret]

type

The type of build environment.

Return type

str

Static Methods

classmethod from_asset(scope, id, props, image_type=None)

Uses an Docker image asset as a Windows build image.

Parameters
Return type

IBuildImage

classmethod from_docker_registry(name, options=None, image_type=None)
Parameters
Return type

IBuildImage

Returns

a Windows build image from a Docker Hub image.

classmethod from_ecr_repository(repository, tag=None, image_type=None)
Parameters
  • repository (IRepository) – The ECR repository.

  • tag (Optional[str]) – Image tag (default “latest”).

  • image_type (Optional[WindowsImageType]) –

Return type

IBuildImage

Returns

A Linux build image 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

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