BuildEnvironment Struct
Example
const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
synth: new pipelines.ShellStep('Synth', {
input: pipelines.CodePipelineSource.connection('my-org/my-app', 'main', {
connectionArn:
'arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41', // Created using the AWS console * });',
}),
commands: ['npm ci', 'npm run build', 'npx cdk synth'],
}),
// Turn this on because the pipeline uses Docker image assets
dockerEnabledForSelfMutation: true,
});
pipeline.addWave('MyWave', {
post: [
new pipelines.CodeBuildStep('RunApproval', {
commands: ['command-from-image'],
buildEnvironment: {
// The user of a Docker image asset in the pipeline requires turning on
// 'dockerEnabledForSelfMutation'.
buildImage: codebuild.LinuxBuildImage.fromAsset(this, 'Image', {
directory: './docker-image',
}),
},
}),
],
});
Properties
buildImageoptionalIBuildImagebuild_imageoptionalIBuildImagebuildImageoptionalIBuildImageBuildImageoptionalIBuildImageBuildImageoptionalIBuildImage= LinuxBuildImage.STANDARD_7_0#certificateoptionalBuildEnvironmentCertificatecertificateoptionalBuildEnvironmentCertificatecertificateoptionalBuildEnvironmentCertificateCertificateoptionalBuildEnvironmentCertificateCertificateoptionalBuildEnvironmentCertificate#Default: No external certificate is added to the project
computeTypeoptionalComputeTypecompute_typeoptionalComputeTypecomputeTypeoptionalComputeTypeComputeTypeoptionalComputeTypeComputeTypeoptionalComputeType#Default: taken from #buildImage#defaultComputeType
See the ComputeType enum for the possible values.
dockerServeroptionalDockerServerOptionsdocker_serveroptionalDockerServerOptionsdockerServeroptionalDockerServerOptionsDockerServeroptionalDockerServerOptionsDockerServeroptionalDockerServerOptions#Default: Doesn't use remote docker server
environmentVariablesoptional{ [key: string]: BuildEnvironmentVariable }environment_variablesoptionaltyping.Mapping[str, BuildEnvironmentVariable]environmentVariablesoptionalMap<String, BuildEnvironmentVariable>EnvironmentVariablesoptionalIDictionary<string, BuildEnvironmentVariable>EnvironmentVariablesoptional*map[string]BuildEnvironmentVariable#Default: No fleet will be attached to the project, which will remain on-demand.
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.
hostKerneloptionalHostKernelhost_kerneloptionalHostKernelhostKerneloptionalHostKernelHostKerneloptionalHostKernelHostKerneloptionalHostKernel#Default: the default host kernel chosen by CodeBuild for the build image
notes
The host kernel does not affect the build environment operating system, which is determined by the buildImage.
Only supported by the LINUX_CONTAINER, ARM_CONTAINER, LINUX_EC2 and ARM_EC2 environment types. Not supported by Windows, Lambda or Mac build images.
privilegedoptionalbooleanprivilegedoptionalboolprivilegedoptionalBooleanPrivilegedoptionalboolPrivilegedoptional*bool= false#notes
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.