interface CodeBuildOptions
Language | Type name |
---|---|
.NET | Amazon.CDK.Pipelines.CodeBuildOptions |
Java | software.amazon.awscdk.pipelines.CodeBuildOptions |
Python | aws_cdk.pipelines.CodeBuildOptions |
TypeScript (source) | @aws-cdk/pipelines » CodeBuildOptions |
Options for customizing a single CodeBuild project.
Example
declare const vpc: ec2.Vpc;
declare const mySecurityGroup: ec2.SecurityGroup;
new pipelines.CodePipeline(this, 'Pipeline', {
// Standard CodePipeline properties
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',
],
}),
// Defaults for all CodeBuild projects
codeBuildDefaults: {
// Prepend commands and configuration to all projects
partialBuildSpec: codebuild.BuildSpec.fromObject({
version: '0.2',
// ...
}),
// Control the build environment
buildEnvironment: {
computeType: codebuild.ComputeType.LARGE,
},
// Control Elastic Network Interface creation
vpc: vpc,
subnetSelection: { subnetType: ec2.SubnetType.PRIVATE_WITH_NAT },
securityGroups: [mySecurityGroup],
// Additional policy statements for the execution role
rolePolicy: [
new iam.PolicyStatement({ /* ... */ }),
],
},
synthCodeBuildDefaults: { /* ... */ },
assetPublishingCodeBuildDefaults: { /* ... */ },
selfMutationCodeBuildDefaults: { /* ... */ },
});
Properties
Name | Type | Description |
---|---|---|
build | Build | Partial build environment, will be combined with other build environments that apply. |
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_5_0)
Partial build environment, will be combined with other build environments that apply.
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.