public static final class CodeBuildStepProps.Builder
extends java.lang.Object
CodeBuildStepProps
Constructor and Description |
---|
Builder() |
public CodeBuildStepProps.Builder buildEnvironment(BuildEnvironment buildEnvironment)
CodeBuildStepProps.getBuildEnvironment()
buildEnvironment
- Changes to environment.
This environment will be combined with the pipeline's default
environment.this
public CodeBuildStepProps.Builder partialBuildSpec(BuildSpec partialBuildSpec)
CodeBuildStepProps.getPartialBuildSpec()
partialBuildSpec
- 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.
this
public CodeBuildStepProps.Builder projectName(java.lang.String projectName)
CodeBuildStepProps.getProjectName()
projectName
- Name for the generated CodeBuild project.this
public CodeBuildStepProps.Builder role(IRole role)
CodeBuildStepProps.getRole()
role
- Custom execution role to be used for the CodeBuild project.this
public CodeBuildStepProps.Builder rolePolicyStatements(java.util.List<? extends PolicyStatement> rolePolicyStatements)
CodeBuildStepProps.getRolePolicyStatements()
rolePolicyStatements
- Policy statements to add to role used during the synth.
Can be used to add acces to a CodeArtifact repository etc.this
public CodeBuildStepProps.Builder securityGroups(java.util.List<? extends ISecurityGroup> securityGroups)
CodeBuildStepProps.getSecurityGroups()
securityGroups
- 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.
this
public CodeBuildStepProps.Builder subnetSelection(SubnetSelection subnetSelection)
CodeBuildStepProps.getSubnetSelection()
subnetSelection
- Which subnets to use.
Only used if 'vpc' is supplied.this
public CodeBuildStepProps.Builder timeout(Duration timeout)
CodeBuildStepProps.getTimeout()
timeout
- 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.this
public CodeBuildStepProps.Builder vpc(IVpc vpc)
CodeBuildStepProps.getVpc()
vpc
- The VPC where to execute the SimpleSynth.this
public CodeBuildStepProps.Builder commands(java.util.List<java.lang.String> commands)
ShellStepProps.getCommands()
commands
- Commands to run. This parameter is required.this
public CodeBuildStepProps.Builder additionalInputs(java.util.Map<java.lang.String,? extends IFileSetProducer> additionalInputs)
ShellStepProps.getAdditionalInputs()
additionalInputs
- 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:
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();
this
public CodeBuildStepProps.Builder env(java.util.Map<java.lang.String,java.lang.String> env)
ShellStepProps.getEnv()
env
- Environment variables to set.this
public CodeBuildStepProps.Builder envFromCfnOutputs(java.util.Map<java.lang.String,? extends CfnOutput> envFromCfnOutputs)
ShellStepProps.getEnvFromCfnOutputs()
envFromCfnOutputs
- Set environment variables based on Stack Outputs.
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.this
public CodeBuildStepProps.Builder input(IFileSetProducer input)
ShellStepProps.getInput()
input
- 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.this
public CodeBuildStepProps.Builder installCommands(java.util.List<java.lang.String> installCommands)
ShellStepProps.getInstallCommands()
installCommands
- 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
.this
public CodeBuildStepProps.Builder primaryOutputDirectory(java.lang.String primaryOutputDirectory)
ShellStepProps.getPrimaryOutputDirectory()
primaryOutputDirectory
- 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.this
public CodeBuildStepProps build()
CodeBuildStepProps
java.lang.NullPointerException
- if any required attribute was not provided