Optional
Readonly
actionCustom execution role to be used for the Code Build Action
Optional
Readonly
buildBuild environment
Optional
Readonly
cacheCaching strategy to use.
Readonly
commandsCommands to run
Readonly
dependencyThe list of FileSets consumed by this Step
Readonly
envEnvironment variables to set
Readonly
envSet environment variables based on Stack Outputs
Optional
Readonly
fileProjectFileSystemLocation 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.
Readonly
idIdentifier for this step
Readonly
inputsInput FileSets
A list of (FileSet, directory)
pairs, which are a copy of the
input properties. This list should not be modified directly.
Readonly
installInstallation 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
.
Readonly
isWhether or not this is a Source step
What it means to be a Source step depends on the engine.
Optional
Readonly
loggingInformation about logs for CodeBuild projects. A CodeBuilde project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
Readonly
outputsOutput FileSets
A list of (FileSet, directory)
pairs, which are a copy of the
input properties. This list should not be modified directly.
Optional
Readonly
projectName for the generated CodeBuild project
Optional
Readonly
roleCustom execution role to be used for the CodeBuild project
Optional
Readonly
rolePolicy statements to add to role used during the synth
Optional
Readonly
securityWhich security group to associate with the script's project network interfaces.
Optional
Readonly
subnetWhich subnets to use.
Optional
Readonly
timeoutThe 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.
Optional
Readonly
vpcThe VPC where to execute the SimpleSynth.
StackOutputReferences this step consumes.
The CodeBuild Project's principal
Additional configuration that can only be configured via BuildSpec
Contains exported variables
CodeBuild Project generated for the pipeline
Will only be available after the pipeline has been built.
Protected
addAdd an additional FileSet to the set of file sets required by this step
This will lead to a dependency on the producer of that file set.
Add an additional output FileSet based on a directory.
After running the script, the contents of the given directory
will be exported as a FileSet
. Use the FileSet
as the
input to another step.
Multiple calls with the exact same directory name string (not normalized) will return the same FileSet.
Add a dependency on another step.
Protected
configureConfigure the given FileSet as the primary output of this step
Protected
discoverCrawl the given structure for references to StepOutputs and add dependencies on all steps found
Should be called in the constructor of subclasses based on what the user passes in as construction properties. The format of the structure passed in here does not have to correspond exactly to what gets rendered into the engine, it just needs to contain the same data.
Reference a CodePipeline variable defined by the CodeBuildStep.
The variable must be set in the shell of the CodeBuild step when
it finishes its post_build
phase.
the name of the variable for reference.
// Access the output of one CodeBuildStep in another CodeBuildStep
declare const pipeline: pipelines.CodePipeline;
const step1 = new pipelines.CodeBuildStep('Step1', {
commands: ['export MY_VAR=hello'],
});
const step2 = new pipelines.CodeBuildStep('Step2', {
env: {
IMPORTED_VAR: step1.exportedVariable('MY_VAR'),
},
commands: ['echo $IMPORTED_VAR'],
});
Configure the given output directory as primary output
If no primary output has been configured yet, this directory will become the primary output of this ShellStep, otherwise this method will throw if the given directory is different than the currently configured primary output directory.
Static
sequence
Run a script as a CodeBuild Project
The BuildSpec must be available inline--it cannot reference a file on disk. If your current build instructions are in a file like
buildspec.yml
in your repository, extract them to a script (say,build.sh
) and invoke that script as part of the build: