Options for customizing a single CodeBuild project.
Namespace: Amazon.CDK.Pipelines
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface ICodeBuildOptions
Syntax (vb)
Public Interface ICodeBuildOptions
Examples
IFileSetProducer source; // the repository source
string[] synthCommands; // Commands to synthesize your app
string[] installCommands;
// Commands to install your toolchain
var pipeline = new CodePipeline(this, "Pipeline", new CodePipelineProps {
// Standard CodePipeline properties...
Synth = new ShellStep("Synth", new ShellStepProps {
Input = source,
Commands = synthCommands
}),
// Configure CodeBuild to use a drop-in Docker replacement.
CodeBuildDefaults = new CodeBuildOptions {
PartialBuildSpec = BuildSpec.FromObject(new Dictionary<string, object> {
{ "phases", new Dictionary<string, IDictionary<string, string[]>> {
{ "install", new Struct {
// Add the shell commands to install your drop-in Docker
// replacement to the CodeBuild enviromment.
Commands = installCommands
} }
} }
}),
BuildEnvironment = new BuildEnvironment {
EnvironmentVariables = new Dictionary<string, BuildEnvironmentVariable> {
// 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", new BuildEnvironmentVariable { Value = "drop-in-replacement" } }
}
}
}
});
Synopsis
Properties
| BuildEnvironment | Partial build environment, will be combined with other build environments that apply. |
| Cache | Caching strategy to use. |
| FileSystemLocations | ProjectFileSystemLocation objects for CodeBuild build projects. |
| Logging | Information about logs for CodeBuild projects. |
| PartialBuildSpec | Partial buildspec, will be combined with other buildspecs that apply. |
| RolePolicy | Policy statements to add to role. |
| SecurityGroups | Which security group(s) to associate with the project network interfaces. |
| SubnetSelection | Which subnets to use. |
| Timeout | The number of minutes after which AWS CodeBuild stops the build if it's not complete. |
| Vpc | The VPC where to create the CodeBuild network interfaces in. |
Properties
BuildEnvironment
Partial build environment, will be combined with other build environments that apply.
IBuildEnvironment? BuildEnvironment { get; }
Property Value
Cache
FileSystemLocations
ProjectFileSystemLocation objects for CodeBuild build projects.
IFileSystemLocation[]? FileSystemLocations { get; }
Property Value
Logging
Information about logs for CodeBuild projects.
ILoggingOptions? Logging { get; }
Property Value
PartialBuildSpec
Partial buildspec, will be combined with other buildspecs that apply.
BuildSpec? PartialBuildSpec { get; }
Property Value
RolePolicy
Policy statements to add to role.
PolicyStatement[]? RolePolicy { get; }
Property Value
SecurityGroups
Which security group(s) to associate with the project network interfaces.
ISecurityGroup[]? SecurityGroups { get; }
Property Value
SubnetSelection
Timeout
The number of minutes after which AWS CodeBuild stops the build if it's not complete.
Duration? Timeout { get; }