public static final class CodeBuildStep.Builder
extends java.lang.Object
CodeBuildStep
.Modifier and Type | Method and Description |
---|---|
CodeBuildStep.Builder |
actionRole(IRole actionRole)
Custom execution role to be used for the Code Build Action.
|
CodeBuildStep.Builder |
additionalInputs(java.util.Map<java.lang.String,? extends IFileSetProducer> additionalInputs)
Additional FileSets to put in other directories.
|
CodeBuildStep |
build() |
CodeBuildStep.Builder |
buildEnvironment(BuildEnvironment buildEnvironment)
Changes to environment.
|
CodeBuildStep.Builder |
commands(java.util.List<java.lang.String> commands)
Commands to run.
|
static CodeBuildStep.Builder |
create(java.lang.String id) |
CodeBuildStep.Builder |
env(java.util.Map<java.lang.String,java.lang.String> env)
Environment variables to set.
|
CodeBuildStep.Builder |
envFromCfnOutputs(java.util.Map<java.lang.String,? extends CfnOutput> envFromCfnOutputs)
Set environment variables based on Stack Outputs.
|
CodeBuildStep.Builder |
input(IFileSetProducer input)
FileSet to run these scripts on.
|
CodeBuildStep.Builder |
installCommands(java.util.List<java.lang.String> installCommands)
Installation commands to run before the regular commands.
|
CodeBuildStep.Builder |
partialBuildSpec(BuildSpec partialBuildSpec)
Additional configuration that can only be configured via BuildSpec.
|
CodeBuildStep.Builder |
primaryOutputDirectory(java.lang.String primaryOutputDirectory)
The directory that will contain the primary output fileset.
|
CodeBuildStep.Builder |
projectName(java.lang.String projectName)
Name for the generated CodeBuild project.
|
CodeBuildStep.Builder |
role(IRole role)
Custom execution role to be used for the CodeBuild project.
|
CodeBuildStep.Builder |
rolePolicyStatements(java.util.List<? extends PolicyStatement> rolePolicyStatements)
Policy statements to add to role used during the synth.
|
CodeBuildStep.Builder |
securityGroups(java.util.List<? extends ISecurityGroup> securityGroups)
Which security group to associate with the script's project network interfaces.
|
CodeBuildStep.Builder |
subnetSelection(SubnetSelection subnetSelection)
Which subnets to use.
|
CodeBuildStep.Builder |
timeout(Duration timeout)
The number of minutes after which AWS CodeBuild stops the build if it's not complete.
|
CodeBuildStep.Builder |
vpc(IVpc vpc)
The VPC where to execute the SimpleSynth.
|
public static CodeBuildStep.Builder create(java.lang.String id)
id
- This parameter is required.CodeBuildStep.Builder
.public CodeBuildStep.Builder commands(java.util.List<java.lang.String> commands)
commands
- Commands to run. This parameter is required.this
public CodeBuildStep.Builder additionalInputs(java.util.Map<java.lang.String,? extends IFileSetProducer> additionalInputs)
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:
ShellStep script = ShellStep.Builder.create("MainScript") .commands(List.of("npm ci", "npm run build", "npx cdk synth")) .input(CodePipelineSource.gitHub("org/source1", "main")) .additionalInputs(Map.of( "../siblingdir", CodePipelineSource.gitHub("org/source2", "main"))) .build();
Default: - No additional inputs
additionalInputs
- Additional FileSets to put in other directories. This parameter is required.this
public CodeBuildStep.Builder env(java.util.Map<java.lang.String,java.lang.String> env)
Default: - No environment variables
env
- Environment variables to set. This parameter is required.this
public CodeBuildStep.Builder envFromCfnOutputs(java.util.Map<java.lang.String,? extends CfnOutput> envFromCfnOutputs)
ShellStep
s following stack or stage deployments may
access the CfnOutput
s of those stacks to get access to
--for example--automatically generated resource names or
endpoint URLs.
Default: - No environment variables created from stack outputs
envFromCfnOutputs
- Set environment variables based on Stack Outputs. This parameter is required.this
public CodeBuildStep.Builder input(IFileSetProducer input)
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.
Default: - No input specified
input
- FileSet to run these scripts on. This parameter is required.this
public CodeBuildStep.Builder installCommands(java.util.List<java.lang.String> installCommands)
For deployment engines that support it, install commands will be classified
differently in the job history from the regular commands
.
Default: - No installation commands
installCommands
- Installation commands to run before the regular commands. This parameter is required.this
public CodeBuildStep.Builder primaryOutputDirectory(java.lang.String primaryOutputDirectory)
After running the script, the contents of the given directory will be treated as the primary output of this Step.
Default: - No primary output
primaryOutputDirectory
- The directory that will contain the primary output fileset. This parameter is required.this
public CodeBuildStep.Builder actionRole(IRole actionRole)
Default: - A role is automatically created
actionRole
- Custom execution role to be used for the Code Build Action. This parameter is required.this
public CodeBuildStep.Builder buildEnvironment(BuildEnvironment buildEnvironment)
This environment will be combined with the pipeline's default environment.
Default: - Use the pipeline's default build environment
buildEnvironment
- Changes to environment. This parameter is required.this
public CodeBuildStep.Builder partialBuildSpec(BuildSpec partialBuildSpec)
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.
Default: - BuildSpec completely derived from other properties
partialBuildSpec
- Additional configuration that can only be configured via BuildSpec. This parameter is required.this
public CodeBuildStep.Builder projectName(java.lang.String projectName)
Default: - Automatically generated
projectName
- Name for the generated CodeBuild project. This parameter is required.this
public CodeBuildStep.Builder role(IRole role)
Default: - A role is automatically created
role
- Custom execution role to be used for the CodeBuild project. This parameter is required.this
public CodeBuildStep.Builder rolePolicyStatements(java.util.List<? extends PolicyStatement> rolePolicyStatements)
Can be used to add acces to a CodeArtifact repository etc.
Default: - No policy statements added to CodeBuild Project Role
rolePolicyStatements
- Policy statements to add to role used during the synth. This parameter is required.this
public CodeBuildStep.Builder securityGroups(java.util.List<? extends ISecurityGroup> securityGroups)
If no security group is identified, one will be created automatically.
Only used if 'vpc' is supplied.
Default: - Security group will be automatically created.
securityGroups
- Which security group to associate with the script's project network interfaces. This parameter is required.this
public CodeBuildStep.Builder subnetSelection(SubnetSelection subnetSelection)
Only used if 'vpc' is supplied.
Default: - All private subnets.
subnetSelection
- Which subnets to use. This parameter is required.this
public CodeBuildStep.Builder timeout(Duration timeout)
For valid values, see the timeoutInMinutes field in the AWS CodeBuild User Guide.
Default: Duration.hours(1)
timeout
- The number of minutes after which AWS CodeBuild stops the build if it's not complete. This parameter is required.this
public CodeBuildStep.Builder vpc(IVpc vpc)
Default: - No VPC
vpc
- The VPC where to execute the SimpleSynth. This parameter is required.this
public CodeBuildStep build()