Construction props for a CodeBuildStep

interface CodeBuildStepProps {
    actionRole?: IRole;
    additionalInputs?: Record<string, IFileSetProducer>;
    buildEnvironment?: BuildEnvironment;
    cache?: Cache;
    commands: string[];
    env?: Record<string, string>;
    envFromCfnOutputs?: Record<string, CfnOutput>;
    fileSystemLocations?: IFileSystemLocation[];
    input?: IFileSetProducer;
    installCommands?: string[];
    logging?: LoggingOptions;
    partialBuildSpec?: BuildSpec;
    primaryOutputDirectory?: string;
    projectName?: string;
    role?: IRole;
    rolePolicyStatements?: PolicyStatement[];
    securityGroups?: ISecurityGroup[];
    subnetSelection?: SubnetSelection;
    timeout?: Duration;
    vpc?: IVpc;
}

Hierarchy (view full)

Properties

actionRole?: IRole

Custom execution role to be used for the Code Build Action

- A role is automatically created
additionalInputs?: Record<string, IFileSetProducer>

Additional FileSets to put in other directories

Specifies a mapping from directory name to FileSets. During the script execution, the FileSets will be available in the directories indicated.

The directory names may be relative. For example, you can put the main input and an additional input side-by-side with the following configuration:

const script = new pipelines.ShellStep('MainScript', {
commands: ['npm ci','npm run build','npx cdk synth'],
input: pipelines.CodePipelineSource.gitHub('org/source1', 'main'),
additionalInputs: {
'../siblingdir': pipelines.CodePipelineSource.gitHub('org/source2', 'main'),
}
});
- No additional inputs
buildEnvironment?: BuildEnvironment

Changes to environment

This environment will be combined with the pipeline's default environment.

- Use the pipeline's default build environment
cache?: Cache

Caching strategy to use.

- No cache
commands: string[]

Commands to run

env?: Record<string, string>

Environment variables to set

- No environment variables
envFromCfnOutputs?: Record<string, CfnOutput>

Set environment variables based on Stack Outputs

ShellSteps following stack or stage deployments may access the CfnOutputs of those stacks to get access to --for example--automatically generated resource names or endpoint URLs.

- No environment variables created from stack outputs
fileSystemLocations?: IFileSystemLocation[]

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.

- no file system locations

FileSet to run these scripts on

The files in the FileSet will be placed in the working directory when the script is executed. Use additionalInputs to download file sets to other directories as well.

- No input specified
installCommands?: string[]

Installation commands to run before the regular commands

For deployment engines that support it, install commands will be classified differently in the job history from the regular commands.

- No installation commands
logging?: LoggingOptions

Information about logs for CodeBuild projects. A CodeBuild project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.

- no log configuration is set
partialBuildSpec?: BuildSpec

Additional configuration that can only be configured via BuildSpec

You should not use this to specify output artifacts; those should be supplied via the other properties of this class, otherwise CDK Pipelines won't be able to inspect the artifacts.

Set the commands to an empty array if you want to fully specify the BuildSpec using this field.

The BuildSpec must be available inline--it cannot reference a file on disk.

- BuildSpec completely derived from other properties
primaryOutputDirectory?: string

The directory that will contain the primary output fileset

After running the script, the contents of the given directory will be treated as the primary output of this Step.

- No primary output
projectName?: string

Name for the generated CodeBuild project

- Automatically generated
role?: IRole

Custom execution role to be used for the CodeBuild project

- A role is automatically created
rolePolicyStatements?: PolicyStatement[]

Policy statements to add to role used during the synth

Can be used to add acces to a CodeArtifact repository etc.

- No policy statements added to CodeBuild Project Role
securityGroups?: ISecurityGroup[]

Which security group to associate with the script's project network interfaces. If no security group is identified, one will be created automatically.

Only used if 'vpc' is supplied.

- Security group will be automatically created.
subnetSelection?: SubnetSelection

Which subnets to use.

Only used if 'vpc' is supplied.

- All private subnets.
timeout?: Duration

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.

Duration.hours(1)
vpc?: IVpc

The VPC where to execute the SimpleSynth.

- No VPC