interface CodeBuildOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.Pipelines.CodeBuildOptions |
Go | github.com/aws/aws-cdk-go/awscdk/v2/pipelines#CodeBuildOptions |
Java | software.amazon.awscdk.pipelines.CodeBuildOptions |
Python | aws_cdk.pipelines.CodeBuildOptions |
TypeScript (source) | aws-cdk-lib » pipelines » CodeBuildOptions |
Options for customizing a single CodeBuild project.
Example
declare const source: pipelines.IFileSetProducer; // the repository source
declare const synthCommands: string[]; // Commands to synthesize your app
declare const installCommands: string[]; // Commands to install your toolchain
const pipeline = new pipelines.CodePipeline(this, 'Pipeline', {
// Standard CodePipeline properties...
synth: new pipelines.ShellStep('Synth', {
input: source,
commands: synthCommands,
}),
// Configure CodeBuild to use a drop-in Docker replacement.
codeBuildDefaults: {
partialBuildSpec: codebuild.BuildSpec.fromObject({
phases: {
install: {
// Add the shell commands to install your drop-in Docker
// replacement to the CodeBuild enviromment.
commands: installCommands,
},
},
}),
buildEnvironment: {
environmentVariables: {
// Instruct the AWS CDK to use `drop-in-replacement` instead of
// `docker` when building / publishing docker images.
// e.g., `drop-in-replacement build . -f path/to/Dockerfile`
CDK_DOCKER: { value: 'drop-in-replacement' },
},
},
},
});
Properties
Name | Type | Description |
---|---|---|
build | Build | Partial build environment, will be combined with other build environments that apply. |
cache? | Cache | Caching strategy to use. |
file | IFile [] | ProjectFileSystemLocation objects for CodeBuild build projects. |
logging? | Logging | Information about logs for CodeBuild projects. |
partial | Build | Partial buildspec, will be combined with other buildspecs that apply. |
role | Policy [] | Policy statements to add to role. |
security | ISecurity [] | Which security group(s) to associate with the project network interfaces. |
subnet | Subnet | Which subnets to use. |
timeout? | Duration | The number of minutes after which AWS CodeBuild stops the build if it's not complete. |
vpc? | IVpc | The VPC where to create the CodeBuild network interfaces in. |
buildEnvironment?
Type:
Build
(optional, default: Non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0)
Partial build environment, will be combined with other build environments that apply.
cache?
Type:
Cache
(optional, default: No cache)
Caching strategy to use.
fileSystemLocations?
Type:
IFile
[]
(optional, default: no file system locations)
ProjectFileSystemLocation objects for CodeBuild build projects.
A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System. Requires a vpc to be set and privileged to be set to true.
logging?
Type:
Logging
(optional, default: no log configuration is set)
Information about logs for CodeBuild projects.
A CodeBuild project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
partialBuildSpec?
Type:
Build
(optional, default: No initial BuildSpec)
Partial buildspec, will be combined with other buildspecs that apply.
The BuildSpec must be available inline--it cannot reference a file on disk.
rolePolicy?
Type:
Policy
[]
(optional, default: No policy statements added to CodeBuild Project Role)
Policy statements to add to role.
securityGroups?
Type:
ISecurity
[]
(optional, default: Security group will be automatically created.)
Which security group(s) to associate with the project network interfaces.
Only used if 'vpc' is supplied.
subnetSelection?
Type:
Subnet
(optional, default: All private subnets.)
Which subnets to use.
Only used if 'vpc' is supplied.
timeout?
Type:
Duration
(optional, default: Duration.hours(1))
The number of minutes after which AWS CodeBuild stops the build if it's not complete.
For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
vpc?
Type:
IVpc
(optional, default: No VPC)
The VPC where to create the CodeBuild network interfaces in.