Class CodeBuildStepProps.Builder

java.lang.Object
software.amazon.awscdk.pipelines.CodeBuildStepProps.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<CodeBuildStepProps>
Enclosing interface:
CodeBuildStepProps

@Stability(Stable) public static final class CodeBuildStepProps.Builder extends Object implements software.amazon.jsii.Builder<CodeBuildStepProps>
A builder for CodeBuildStepProps
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • actionRole

      @Stability(Stable) public CodeBuildStepProps.Builder actionRole(IRole actionRole)
      Parameters:
      actionRole - Custom execution role to be used for the Code Build Action.
      Returns:
      this
    • buildEnvironment

      @Stability(Stable) public CodeBuildStepProps.Builder buildEnvironment(BuildEnvironment buildEnvironment)
      Parameters:
      buildEnvironment - Changes to environment. This environment will be combined with the pipeline's default environment.
      Returns:
      this
    • partialBuildSpec

      @Stability(Stable) public CodeBuildStepProps.Builder partialBuildSpec(BuildSpec partialBuildSpec)
      Parameters:
      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.

      Returns:
      this
    • projectName

      @Stability(Stable) public CodeBuildStepProps.Builder projectName(String projectName)
      Parameters:
      projectName - Name for the generated CodeBuild project.
      Returns:
      this
    • role

      @Stability(Stable) public CodeBuildStepProps.Builder role(IRole role)
      Parameters:
      role - Custom execution role to be used for the CodeBuild project.
      Returns:
      this
    • rolePolicyStatements

      @Stability(Stable) public CodeBuildStepProps.Builder rolePolicyStatements(List<? extends PolicyStatement> rolePolicyStatements)
      Parameters:
      rolePolicyStatements - Policy statements to add to role used during the synth. Can be used to add acces to a CodeArtifact repository etc.
      Returns:
      this
    • securityGroups

      @Stability(Stable) public CodeBuildStepProps.Builder securityGroups(List<? extends ISecurityGroup> securityGroups)
      Parameters:
      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.

      Returns:
      this
    • subnetSelection

      @Stability(Stable) public CodeBuildStepProps.Builder subnetSelection(SubnetSelection subnetSelection)
      Parameters:
      subnetSelection - Which subnets to use. Only used if 'vpc' is supplied.
      Returns:
      this
    • timeout

      @Stability(Stable) public CodeBuildStepProps.Builder timeout(Duration timeout)
      Parameters:
      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.
      Returns:
      this
    • vpc

      @Stability(Stable) public CodeBuildStepProps.Builder vpc(IVpc vpc)
      Sets the value of CodeBuildStepProps.getVpc()
      Parameters:
      vpc - The VPC where to execute the SimpleSynth.
      Returns:
      this
    • commands

      @Stability(Stable) public CodeBuildStepProps.Builder commands(List<String> commands)
      Parameters:
      commands - Commands to run. This parameter is required.
      Returns:
      this
    • additionalInputs

      @Stability(Stable) public CodeBuildStepProps.Builder additionalInputs(Map<String,? extends IFileSetProducer> additionalInputs)
      Parameters:
      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();
                               
      Returns:
      this
    • env

      @Stability(Stable) public CodeBuildStepProps.Builder env(Map<String,String> env)
      Sets the value of ShellStepProps.getEnv()
      Parameters:
      env - Environment variables to set.
      Returns:
      this
    • envFromCfnOutputs

      @Stability(Stable) public CodeBuildStepProps.Builder envFromCfnOutputs(Map<String,? extends CfnOutput> envFromCfnOutputs)
      Parameters:
      envFromCfnOutputs - 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.
      Returns:
      this
    • input

      @Stability(Stable) public CodeBuildStepProps.Builder input(IFileSetProducer input)
      Sets the value of ShellStepProps.getInput()
      Parameters:
      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.
      Returns:
      this
    • installCommands

      @Stability(Stable) public CodeBuildStepProps.Builder installCommands(List<String> installCommands)
      Parameters:
      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.
      Returns:
      this
    • primaryOutputDirectory

      @Stability(Stable) public CodeBuildStepProps.Builder primaryOutputDirectory(String primaryOutputDirectory)
      Parameters:
      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.
      Returns:
      this
    • build

      @Stability(Stable) public CodeBuildStepProps build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<CodeBuildStepProps>
      Returns:
      a new instance of CodeBuildStepProps
      Throws:
      NullPointerException - if any required attribute was not provided