Optional ReadonlyactionCustom execution role to be used for the Code Build Action
Optional ReadonlybuildBuild environment
Optional ReadonlycacheCaching strategy to use.
ReadonlycommandsCommands to run
ReadonlydependencyThe list of FileSets consumed by this Step
ReadonlyenvEnvironment variables to set
ReadonlyenvSet environment variables based on Stack Outputs
Optional ReadonlyfileProjectFileSystemLocation 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.
ReadonlyidIdentifier for this step
ReadonlyinputsInput FileSets
A list of (FileSet, directory) pairs, which are a copy of the
input properties. This list should not be modified directly.
ReadonlyinstallInstallation 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.
ReadonlyisWhether or not this is a Source step
What it means to be a Source step depends on the engine.
Optional ReadonlyloggingInformation about logs for CodeBuild projects. A CodeBuilde project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.
ReadonlyoutputsOutput FileSets
A list of (FileSet, directory) pairs, which are a copy of the
input properties. This list should not be modified directly.
Optional ReadonlyprojectName for the generated CodeBuild project
Optional ReadonlyroleCustom execution role to be used for the CodeBuild project
Optional ReadonlyrolePolicy statements to add to role used during the synth
Optional ReadonlysecurityWhich security group to associate with the script's project network interfaces.
Optional ReadonlysubnetWhich subnets to use.
Optional ReadonlytimeoutThe 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 ReadonlyvpcThe VPC where to execute the SimpleSynth.
StackOutputReferences this step consumes.
Return the steps this step depends on, based on the FileSets it requires
The CodeBuild Project's principal
The primary FileSet produced by this Step
Not all steps produce an output FileSet--if they do
you can substitute the Step object for the FileSet object.
CodeBuild Project generated for the pipeline
Will only be available after the pipeline has been built.
InternalSet the internal project value
ProtectedaddAdd 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.
ProtectedconfigureProtecteddiscoverCrawl 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.
Return a string representation of this Step
Staticsequence
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.ymlin your repository, extract them to a script (say,build.sh) and invoke that script as part of the build: