Interface CodeBuildStepProps

All Superinterfaces:
software.amazon.jsii.JsiiSerializable, ShellStepProps
All Known Implementing Classes:
CodeBuildStepProps.Jsii$Proxy

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-24T21:00:38.812Z") @Stability(Stable) public interface CodeBuildStepProps extends software.amazon.jsii.JsiiSerializable, ShellStepProps
Construction props for a CodeBuildStep.

Example:

 CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
         .synth(ShellStep.Builder.create("Synth")
                 .input(CodePipelineSource.connection("my-org/my-app", "main", ConnectionSourceOptions.builder()
                         .connectionArn("arn:aws:codestar-connections:us-east-1:222222222222:connection/7d2469ff-514a-4e4f-9003-5ca4a43cdc41")
                         .build()))
                 .commands(List.of("npm ci", "npm run build", "npx cdk synth"))
                 .build())
         // Turn this on because the pipeline uses Docker image assets
         .dockerEnabledForSelfMutation(true)
         .build();
 pipeline.addWave("MyWave", WaveOptions.builder()
         .post(List.of(
             CodeBuildStep.Builder.create("RunApproval")
                     .commands(List.of("command-from-image"))
                     .buildEnvironment(BuildEnvironment.builder()
                             // The user of a Docker image asset in the pipeline requires turning on
                             // 'dockerEnabledForSelfMutation'.
                             .buildImage(LinuxBuildImage.fromAsset(this, "Image", DockerImageAssetProps.builder()
                                     .directory("./docker-image")
                                     .build()))
                             .build())
                     .build()))
         .build());
 
  • Method Details

    • getActionRole

      @Stability(Stable) @Nullable default IRole getActionRole()
      Custom execution role to be used for the Code Build Action.

      Default: - A role is automatically created

    • getBuildEnvironment

      @Stability(Stable) @Nullable default BuildEnvironment getBuildEnvironment()
      Changes to environment.

      This environment will be combined with the pipeline's default environment.

      Default: - Use the pipeline's default build environment

    • getCache

      @Stability(Stable) @Nullable default Cache getCache()
      Caching strategy to use.

      Default: - No cache

    • getFileSystemLocations

      @Stability(Stable) @Nullable default List<IFileSystemLocation> getFileSystemLocations()
      ProjectFileSystemLocation 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.

      Default: - no file system locations

    • getLogging

      @Stability(Stable) @Nullable default LoggingOptions getLogging()
      Information about logs for CodeBuild projects.

      A CodeBuild project can create logs in Amazon CloudWatch Logs, an S3 bucket, or both.

      Default: - no log configuration is set

    • getPartialBuildSpec

      @Stability(Stable) @Nullable default BuildSpec getPartialBuildSpec()
      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.

      Default: - BuildSpec completely derived from other properties

    • getProjectName

      @Stability(Stable) @Nullable default String getProjectName()
      Name for the generated CodeBuild project.

      Default: - Automatically generated

    • getRole

      @Stability(Stable) @Nullable default IRole getRole()
      Custom execution role to be used for the CodeBuild project.

      Default: - A role is automatically created

    • getRolePolicyStatements

      @Stability(Stable) @Nullable default List<PolicyStatement> getRolePolicyStatements()
      Policy statements to add to role used during the synth.

      Can be used to add acces to a CodeArtifact repository etc.

      Default: - No policy statements added to CodeBuild Project Role

    • getSecurityGroups

      @Stability(Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
      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.

      Default: - Security group will be automatically created.

    • getSubnetSelection

      @Stability(Stable) @Nullable default SubnetSelection getSubnetSelection()
      Which subnets to use.

      Only used if 'vpc' is supplied.

      Default: - All private subnets.

    • getTimeout

      @Stability(Stable) @Nullable default Duration getTimeout()
      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.

      Default: Duration.hours(1)

    • getVpc

      @Stability(Stable) @Nullable default IVpc getVpc()
      The VPC where to execute the SimpleSynth.

      Default: - No VPC

    • builder

      @Stability(Stable) static CodeBuildStepProps.Builder builder()
      Returns:
      a CodeBuildStepProps.Builder of CodeBuildStepProps