Class WindowsBuildImage
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codebuild.WindowsBuildImage
- All Implemented Interfaces:
IBuildImage,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.116.0 (build 0eddcff)",
date="2025-10-29T11:15:34.836Z")
@Stability(Stable)
public class WindowsBuildImage
extends software.amazon.jsii.JsiiObject
implements IBuildImage
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])
Example:
Repository ecrRepository;
Project.Builder.create(this, "Project")
.environment(BuildEnvironment.builder()
.buildImage(WindowsBuildImage.fromEcrRepository(ecrRepository, "v1.0", WindowsImageType.SERVER_2019))
// optional certificate to include in the build image
.certificate(BuildEnvironmentCertificate.builder()
.bucket(Bucket.fromBucketName(this, "Bucket", "amzn-s3-demo-bucket"))
.objectKey("path/to/cert.pem")
.build())
.build())
.build();
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.codebuild.IBuildImage
IBuildImage.Jsii$Default, IBuildImage.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IBuildImageThe standard CodeBuild imageaws/codebuild/windows-base:2019-1.0, which is based off Windows Server Core 2019.static final IBuildImageThe standard CodeBuild imageaws/codebuild/windows-base:2019-2.0, which is based off Windows Server Core 2019.static final IBuildImageThe standard CodeBuild imageaws/codebuild/windows-base:2019-3.0, which is based off Windows Server Core 2019.static final IBuildImageThe standard CodeBuild imageaws/codebuild/windows-base:2022-1.0, which is based off Windows Server Core 2022.static final IBuildImageDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedWindowsBuildImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedWindowsBuildImage(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic IBuildImagefromAsset(software.constructs.Construct scope, String id, DockerImageAssetProps props) Uses an Docker image asset as a Windows build image.static IBuildImagefromAsset(software.constructs.Construct scope, String id, DockerImageAssetProps props, WindowsImageType imageType) Uses an Docker image asset as a Windows build image.static IBuildImagefromDockerRegistry(String name) static IBuildImagefromDockerRegistry(String name, DockerImageOptions options) static IBuildImagefromDockerRegistry(String name, DockerImageOptions options, WindowsImageType imageType) static IBuildImagefromEcrRepository(IRepository repository) static IBuildImagefromEcrRepository(IRepository repository, String tagOrDigest) static IBuildImagefromEcrRepository(IRepository repository, String tagOrDigest, WindowsImageType imageType) The defaultComputeTypeto use with this image, if one was not specified inBuildEnvironment#computeTypeexplicitly.The Docker image identifier that the build environment uses.The type of principal that CodeBuild will use to pull this build Docker image.An optional ECR repository that the image is hosted in.The secretsManagerCredentials for access to a private registry.getType()The type of build environment.runScriptBuildspec(String entrypoint) Make a buildspec to run the indicated script.validate(BuildEnvironment buildEnvironment) Allows the image a chance to validate whether the passed configuration is correct.Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
WIN_SERVER_CORE_2019_BASE
The standard CodeBuild imageaws/codebuild/windows-base:2019-1.0, which is based off Windows Server Core 2019. -
WIN_SERVER_CORE_2019_BASE_2_0
The standard CodeBuild imageaws/codebuild/windows-base:2019-2.0, which is based off Windows Server Core 2019. -
WIN_SERVER_CORE_2019_BASE_3_0
The standard CodeBuild imageaws/codebuild/windows-base:2019-3.0, which is based off Windows Server Core 2019. -
WIN_SERVER_CORE_2022_BASE_3_0
The standard CodeBuild imageaws/codebuild/windows-base:2022-1.0, which is based off Windows Server Core 2022.Notice: Cannot be used with on-demand compute, only with a
.invalid reference
BuildEnvironment.fleet- See Also:
-
WINDOWS_BASE_2_0
Deprecated.should be used instead.invalid reference
WindowsBuildImage.WIN_SERVER_CORE_2019_BASE_3_0(deprecated) The standard CodeBuild imageaws/codebuild/windows-base:2.0, which is based off Windows Server Core 2016.
-
-
Constructor Details
-
WindowsBuildImage
protected WindowsBuildImage(software.amazon.jsii.JsiiObjectRef objRef) -
WindowsBuildImage
protected WindowsBuildImage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
-
-
Method Details
-
fromAsset
@Stability(Stable) @NotNull public static IBuildImage fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DockerImageAssetProps props, @Nullable WindowsImageType imageType) Uses an Docker image asset as a Windows build image.- Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.imageType-
-
fromAsset
@Stability(Stable) @NotNull public static IBuildImage fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull DockerImageAssetProps props) Uses an Docker image asset as a Windows build image.- Parameters:
scope- This parameter is required.id- This parameter is required.props- This parameter is required.
-
fromDockerRegistry
@Stability(Stable) @NotNull public static IBuildImage fromDockerRegistry(@NotNull String name, @Nullable DockerImageOptions options, @Nullable WindowsImageType imageType) - Parameters:
name- This parameter is required.options-imageType-- Returns:
- a Windows build image from a Docker Hub image.
-
fromDockerRegistry
@Stability(Stable) @NotNull public static IBuildImage fromDockerRegistry(@NotNull String name, @Nullable DockerImageOptions options) - Parameters:
name- This parameter is required.options-- Returns:
- a Windows build image from a Docker Hub image.
-
fromDockerRegistry
- Parameters:
name- This parameter is required.- Returns:
- a Windows build image from a Docker Hub image.
-
fromEcrRepository
@Stability(Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository, @Nullable String tagOrDigest, @Nullable WindowsImageType imageType) - Parameters:
repository- The ECR repository. This parameter is required.tagOrDigest- Image tag or digest (default "latest", digests must start withsha256:).imageType-- Returns:
- A Windows 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 Also:
-
fromEcrRepository
@Stability(Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository, @Nullable String tagOrDigest) - Parameters:
repository- The ECR repository. This parameter is required.tagOrDigest- Image tag or digest (default "latest", digests must start withsha256:).- Returns:
- A Windows 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 Also:
-
fromEcrRepository
@Stability(Stable) @NotNull public static IBuildImage fromEcrRepository(@NotNull IRepository repository) - Parameters:
repository- The ECR repository. This parameter is required.- Returns:
- A Windows 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 Also:
-
runScriptBuildspec
Make a buildspec to run the indicated script.- Specified by:
runScriptBuildspecin interfaceIBuildImage- Parameters:
entrypoint- This parameter is required.
-
validate
@Stability(Stable) @NotNull public List<String> validate(@NotNull BuildEnvironment buildEnvironment) Allows the image a chance to validate whether the passed configuration is correct.- Specified by:
validatein interfaceIBuildImage- Parameters:
buildEnvironment- This parameter is required.
-
getDefaultComputeType
The defaultComputeTypeto use with this image, if one was not specified inBuildEnvironment#computeTypeexplicitly.- Specified by:
getDefaultComputeTypein interfaceIBuildImage
-
getImageId
The Docker image identifier that the build environment uses.- Specified by:
getImageIdin interfaceIBuildImage- See Also:
-
getType
The type of build environment.- Specified by:
getTypein interfaceIBuildImage
-
getImagePullPrincipalType
The type of principal that CodeBuild will use to pull this build Docker image.- Specified by:
getImagePullPrincipalTypein interfaceIBuildImage
-
getRepository
An optional ECR repository that the image is hosted in.- Specified by:
getRepositoryin interfaceIBuildImage
-
getSecretsManagerCredentials
The secretsManagerCredentials for access to a private registry.- Specified by:
getSecretsManagerCredentialsin interfaceIBuildImage
-
invalid reference