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.84.0 (build 5404dcf)",
date="2023-06-19T16:30:41.855Z")
@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", "my-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.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.codebuild.IBuildImage
IBuildImage.Jsii$Default, IBuildImage.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final IBuildImage
Deprecated.static final IBuildImage
The standard CodeBuild imageaws/codebuild/windows-base:2019-1.0
, which is based off Windows Server Core 2019.static final IBuildImage
The standard CodeBuild imageaws/codebuild/windows-base:2.0
, which is based off Windows Server Core 2016. -
Constructor Summary
ModifierConstructorDescriptionprotected
WindowsBuildImage
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
WindowsBuildImage
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Modifier and TypeMethodDescriptionstatic IBuildImage
fromAsset
(software.constructs.Construct scope, String id, DockerImageAssetProps props) Uses an Docker image asset as a Windows build image.static IBuildImage
fromAsset
(software.constructs.Construct scope, String id, DockerImageAssetProps props, WindowsImageType imageType) Uses an Docker image asset as a Windows build image.static IBuildImage
fromDockerRegistry
(String name) static IBuildImage
fromDockerRegistry
(String name, DockerImageOptions options) static IBuildImage
fromDockerRegistry
(String name, DockerImageOptions options, WindowsImageType imageType) static IBuildImage
fromEcrRepository
(IRepository repository) static IBuildImage
fromEcrRepository
(IRepository repository, String tagOrDigest) static IBuildImage
fromEcrRepository
(IRepository repository, String tagOrDigest, WindowsImageType imageType) The defaultComputeType
to use with this image, if one was not specified ininvalid @link
BuildEnvironment#computeType
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, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
WIN_SERVER_CORE_2016_BASE
Deprecated.WindowsBuildImage.WINDOWS_BASE_2_0
should be used instead.(deprecated) Corresponds to the standard CodeBuild imageaws/codebuild/windows-base:1.0
. -
WIN_SERVER_CORE_2019_BASE
The standard CodeBuild imageaws/codebuild/windows-base:2019-1.0
, which is based off Windows Server Core 2019. -
WINDOWS_BASE_2_0
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:
runScriptBuildspec
in 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:
validate
in interfaceIBuildImage
- Parameters:
buildEnvironment
- This parameter is required.
-
getDefaultComputeType
The defaultComputeType
to use with this image, if one was not specified ininvalid @link
BuildEnvironment#computeType
- Specified by:
getDefaultComputeType
in interfaceIBuildImage
-
getImageId
The Docker image identifier that the build environment uses.- Specified by:
getImageId
in interfaceIBuildImage
- See Also:
-
getType
The type of build environment.- Specified by:
getType
in interfaceIBuildImage
-
getImagePullPrincipalType
The type of principal that CodeBuild will use to pull this build Docker image.- Specified by:
getImagePullPrincipalType
in interfaceIBuildImage
-
getRepository
An optional ECR repository that the image is hosted in.- Specified by:
getRepository
in interfaceIBuildImage
-
getSecretsManagerCredentials
The secretsManagerCredentials for access to a private registry.- Specified by:
getSecretsManagerCredentials
in interfaceIBuildImage
-
WindowsBuildImage.WINDOWS_BASE_2_0
should be used instead.