Interface CodeBuildOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CodeBuildOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:15.263Z") @Stability(Stable) public interface CodeBuildOptions extends software.amazon.jsii.JsiiSerializable
Options for customizing a single CodeBuild project.

Example:

 IFileSetProducer source; // the repository source
 String[] synthCommands; // Commands to synthesize your app
 String[] installCommands;
 // Commands to install your toolchain
 CodePipeline pipeline = CodePipeline.Builder.create(this, "Pipeline")
         // Standard CodePipeline properties...
         .synth(ShellStep.Builder.create("Synth")
                 .input(source)
                 .commands(synthCommands)
                 .build())
         // Configure CodeBuild to use a drop-in Docker replacement.
         .codeBuildDefaults(CodeBuildOptions.builder()
                 .partialBuildSpec(BuildSpec.fromObject(Map.of(
                         "phases", Map.of(
                                 "install", Map.of(
                                         // Add the shell commands to install your drop-in Docker
                                         // replacement to the CodeBuild enviromment.
                                         "commands", installCommands)))))
                 .buildEnvironment(BuildEnvironment.builder()
                         .environmentVariables(Map.of(
                                 // Instruct the AWS CDK to use `drop-in-replacement` instead of
                                 // `docker` when building / publishing docker images.
                                 // e.g., `drop-in-replacement build . -f path/to/Dockerfile`
                                 "CDK_DOCKER", BuildEnvironmentVariable.builder().value("drop-in-replacement").build()))
                         .build())
                 .build())
         .build();
 
  • Method Details

    • getBuildEnvironment

      @Stability(Stable) @Nullable default BuildEnvironment getBuildEnvironment()
      Partial build environment, will be combined with other build environments that apply.

      Default: - Non-privileged build, SMALL instance, LinuxBuildImage.STANDARD_7_0

    • 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. Requires a vpc to be set and privileged to be set to true.

      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()
      Partial buildspec, will be combined with other buildspecs that apply.

      The BuildSpec must be available inline--it cannot reference a file on disk.

      Default: - No initial BuildSpec

    • getRolePolicy

      @Stability(Stable) @Nullable default List<PolicyStatement> getRolePolicy()
      Policy statements to add to role.

      Default: - No policy statements added to CodeBuild Project Role

    • getSecurityGroups

      @Stability(Stable) @Nullable default List<ISecurityGroup> getSecurityGroups()
      Which security group(s) to associate with the project network interfaces.

      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 create the CodeBuild network interfaces in.

      Default: - No VPC

    • builder

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