Interface CodeBuildOptions

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

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:49.781Z") @Stability(Stable) public interface CodeBuildOptions extends software.amazon.jsii.JsiiSerializable
Options for customizing a single CodeBuild project.

Example:

 Vpc vpc;
 SecurityGroup mySecurityGroup;
 CodePipeline.Builder.create(this, "Pipeline")
         // Standard CodePipeline properties
         .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())
         // Defaults for all CodeBuild projects
         .codeBuildDefaults(CodeBuildOptions.builder()
                 // Prepend commands and configuration to all projects
                 .partialBuildSpec(BuildSpec.fromObject(Map.of(
                         "version", "0.2")))
                 // Control the build environment
                 .buildEnvironment(BuildEnvironment.builder()
                         .computeType(ComputeType.LARGE)
                         .build())
                 // Control Elastic Network Interface creation
                 .vpc(vpc)
                 .subnetSelection(SubnetSelection.builder().subnetType(SubnetType.PRIVATE_WITH_NAT).build())
                 .securityGroups(List.of(mySecurityGroup))
                 // Additional policy statements for the execution role
                 .rolePolicy(List.of(
                     PolicyStatement.Builder.create().build()))
                 .build())
         .synthCodeBuildDefaults(CodeBuildOptions.builder().build())
         .assetPublishingCodeBuildDefaults(CodeBuildOptions.builder().build())
         .selfMutationCodeBuildDefaults(CodeBuildOptions.builder().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_5_0

    • 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