Show / Hide Table of Contents

Class WindowsBuildImage

A CodeBuild image running Windows.

Inheritance
System.Object
WindowsBuildImage
Implements
IBuildImage
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.AWS.CodeBuild.dll
Syntax (csharp)
public class WindowsBuildImage : DeputyBase, IBuildImage
Syntax (vb)
Public Class WindowsBuildImage
    Inherits DeputyBase
    Implements IBuildImage
Remarks

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:

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

    ExampleMetadata: infused

    Examples
    Repository ecrRepository;
    
    
    new Project(this, "Project", new ProjectProps {
        Environment = new BuildEnvironment {
            BuildImage = WindowsBuildImage.FromEcrRepository(ecrRepository, "v1.0", WindowsImageType.SERVER_2019),
            // optional certificate to include in the build image
            Certificate = new BuildEnvironmentCertificate {
                Bucket = Bucket.FromBucketName(this, "Bucket", "my-bucket"),
                ObjectKey = "path/to/cert.pem"
            }
        }
    });

    Synopsis

    Constructors

    WindowsBuildImage(ByRefValue)

    Used by jsii to construct an instance of this class from a Javascript-owned object reference

    WindowsBuildImage(DeputyBase.DeputyProps)

    Used by jsii to construct an instance of this class from DeputyProps

    Properties

    DefaultComputeType

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

    ImageId

    The Docker image identifier that the build environment uses.

    ImagePullPrincipalType

    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.

    SecretsManagerCredentials

    The secretsManagerCredentials for access to a private registry.

    Type

    The type of build environment.

    WIN_SERVER_CORE_2016_BASE

    (deprecated) Corresponds to the standard CodeBuild image aws/codebuild/windows-base:1.0.

    WIN_SERVER_CORE_2019_BASE

    The standard CodeBuild image aws/codebuild/windows-base:2019-1.0, which is based off Windows Server Core 2019.

    WINDOWS_BASE_2_0

    The standard CodeBuild image aws/codebuild/windows-base:2.0, which is based off Windows Server Core 2016.

    Methods

    FromAsset(Construct, String, IDockerImageAssetProps, Nullable<WindowsImageType>)

    Uses an Docker image asset as a Windows build image.

    FromDockerRegistry(String, IDockerImageOptions, Nullable<WindowsImageType>)
    FromEcrRepository(IRepository, String, Nullable<WindowsImageType>)
    RunScriptBuildspec(String)

    Make a buildspec to run the indicated script.

    Validate(IBuildEnvironment)

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

    Constructors

    WindowsBuildImage(ByRefValue)

    Used by jsii to construct an instance of this class from a Javascript-owned object reference

    protected WindowsBuildImage(ByRefValue reference)
    Parameters
    reference Amazon.JSII.Runtime.Deputy.ByRefValue

    The Javascript-owned object reference

    WindowsBuildImage(DeputyBase.DeputyProps)

    Used by jsii to construct an instance of this class from DeputyProps

    protected WindowsBuildImage(DeputyBase.DeputyProps props)
    Parameters
    props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

    The deputy props

    Properties

    DefaultComputeType

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

    public virtual ComputeType DefaultComputeType { get; }
    Property Value

    ComputeType

    ImageId

    The Docker image identifier that the build environment uses.

    public virtual string ImageId { get; }
    Property Value

    System.String

    ImagePullPrincipalType

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

    public virtual Nullable<ImagePullPrincipalType> ImagePullPrincipalType { get; }
    Property Value

    System.Nullable<ImagePullPrincipalType>

    Repository

    An optional ECR repository that the image is hosted in.

    public virtual IRepository Repository { get; }
    Property Value

    IRepository

    SecretsManagerCredentials

    The secretsManagerCredentials for access to a private registry.

    public virtual ISecret SecretsManagerCredentials { get; }
    Property Value

    ISecret

    Type

    The type of build environment.

    public virtual string Type { get; }
    Property Value

    System.String

    WIN_SERVER_CORE_2016_BASE

    (deprecated) Corresponds to the standard CodeBuild image aws/codebuild/windows-base:1.0.

    public static IBuildImage WIN_SERVER_CORE_2016_BASE { get; }
    Property Value

    IBuildImage

    Remarks

    Stability: Deprecated

    WIN_SERVER_CORE_2019_BASE

    The standard CodeBuild image aws/codebuild/windows-base:2019-1.0, which is based off Windows Server Core 2019.

    public static IBuildImage WIN_SERVER_CORE_2019_BASE { get; }
    Property Value

    IBuildImage

    WINDOWS_BASE_2_0

    The standard CodeBuild image aws/codebuild/windows-base:2.0, which is based off Windows Server Core 2016.

    public static IBuildImage WINDOWS_BASE_2_0 { get; }
    Property Value

    IBuildImage

    Methods

    FromAsset(Construct, String, IDockerImageAssetProps, Nullable<WindowsImageType>)

    Uses an Docker image asset as a Windows build image.

    public static IBuildImage FromAsset(Construct scope, string id, IDockerImageAssetProps props, Nullable<WindowsImageType> imageType = null)
    Parameters
    scope Constructs.Construct
    id System.String
    props IDockerImageAssetProps
    imageType System.Nullable<WindowsImageType>
    Returns

    IBuildImage

    FromDockerRegistry(String, IDockerImageOptions, Nullable<WindowsImageType>)

    public static IBuildImage FromDockerRegistry(string name, IDockerImageOptions options = null, Nullable<WindowsImageType> imageType = null)
    Parameters
    name System.String
    options IDockerImageOptions
    imageType System.Nullable<WindowsImageType>
    Returns

    IBuildImage

    a Windows build image from a Docker Hub image.

    FromEcrRepository(IRepository, String, Nullable<WindowsImageType>)

    public static IBuildImage FromEcrRepository(IRepository repository, string tagOrDigest = null, Nullable<WindowsImageType> imageType = null)
    Parameters
    repository IRepository

    The ECR repository.

    tagOrDigest System.String

    Image tag or digest (default "latest", digests must start with sha256:).

    imageType System.Nullable<WindowsImageType>

    The ECR repository.

    Returns

    IBuildImage

    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.

    Remarks

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

    RunScriptBuildspec(String)

    Make a buildspec to run the indicated script.

    public virtual BuildSpec RunScriptBuildspec(string entrypoint)
    Parameters
    entrypoint System.String
    Returns

    BuildSpec

    Validate(IBuildEnvironment)

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

    public virtual string[] Validate(IBuildEnvironment buildEnvironment)
    Parameters
    buildEnvironment IBuildEnvironment
    Returns

    System.String[]

    Implements

    IBuildImage
    Back to top Generated by DocFX