Class BuildEnvironment
Inheritance
Implements
Namespace: Amazon.CDK.AWS.CodeBuild
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BuildEnvironment : Object, IBuildEnvironment
Syntax (vb)
Public Class BuildEnvironment
Inherits Object
Implements IBuildEnvironment
Remarks
ExampleMetadata: infused
Examples
var pipeline = new CodePipeline(this, "Pipeline", new CodePipelineProps {
Synth = new ShellStep("Synth", new ShellStepProps {
Input = CodePipelineSource.Connection("my-org/my-app", "main", new ConnectionSourceOptions {
ConnectionArn = "arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41"
}),
Commands = new [] { "npm ci", "npm run build", "npx cdk synth" }
}),
// Turn this on because the pipeline uses Docker image assets
DockerEnabledForSelfMutation = true
});
pipeline.AddWave("MyWave", new WaveOptions {
Post = new [] {
new CodeBuildStep("RunApproval", new CodeBuildStepProps {
Commands = new [] { "command-from-image" },
BuildEnvironment = new BuildEnvironment {
// The user of a Docker image asset in the pipeline requires turning on
// 'dockerEnabledForSelfMutation'.
BuildImage = LinuxBuildImage.FromAsset(this, "Image", new DockerImageAssetProps {
Directory = "./docker-image"
})
}
}) }
});
Synopsis
Constructors
BuildEnvironment() |
Properties
BuildImage | The image used for the builds. |
Certificate | The location of the PEM-encoded certificate for the build project. |
ComputeType | The type of compute to use for this build. |
EnvironmentVariables | The environment variables that your builds can use. |
Fleet | Fleet resource for a reserved capacity CodeBuild project. |
Privileged | Indicates how the project builds Docker images. |
Constructors
BuildEnvironment()
public BuildEnvironment()
Properties
BuildImage
The image used for the builds.
public IBuildImage BuildImage { get; set; }
Property Value
Remarks
Default: LinuxBuildImage.STANDARD_1_0
Certificate
The location of the PEM-encoded certificate for the build project.
public IBuildEnvironmentCertificate Certificate { get; set; }
Property Value
Remarks
Default: - No external certificate is added to the project
ComputeType
The type of compute to use for this build.
public Nullable<ComputeType> ComputeType { get; set; }
Property Value
System.Nullable<ComputeType>
Remarks
See the ComputeType
enum for the possible values.
Default: taken from #buildImage#defaultComputeType
EnvironmentVariables
The environment variables that your builds can use.
public IDictionary<string, IBuildEnvironmentVariable> EnvironmentVariables { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, IBuildEnvironmentVariable>
Fleet
Fleet resource for a reserved capacity CodeBuild project.
public IFleet Fleet { get; set; }
Property Value
Remarks
Fleets allow for process builds or tests to run immediately and reduces build durations, by reserving compute resources for your projects.
You will be charged for the resources in the fleet, even if they are idle.
Default: - No fleet will be attached to the project, which will remain on-demand.
See: https://docs.aws.amazon.com/codebuild/latest/userguide/fleets.html
Privileged
Indicates how the project builds Docker images.
public Nullable<bool> Privileged { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
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