java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.codebuild.BuildSpec
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.97.0 (build 729de35)", date="2024-04-18T17:54:14.017Z") @Stability(Stable) public abstract class BuildSpec extends software.amazon.jsii.JsiiObject
BuildSpec for CodeBuild projects.

Example:

 import software.amazon.awscdk.services.codebuild.*;
 Project codebuildProject = Project.Builder.create(this, "Project")
         .projectName("MyTestProject")
         .buildSpec(BuildSpec.fromObject(Map.of(
                 "version", "0.2",
                 "phases", Map.of(
                         "build", Map.of(
                                 "commands", List.of("echo \"Hello, CodeBuild!\""))))))
         .build();
 CodeBuildStartBuild task = CodeBuildStartBuild.Builder.create(this, "Task")
         .project(codebuildProject)
         .integrationPattern(IntegrationPattern.RUN_JOB)
         .environmentVariablesOverride(Map.of(
                 "ZONE", BuildEnvironmentVariable.builder()
                         .type(BuildEnvironmentVariableType.PLAINTEXT)
                         .value(JsonPath.stringAt("$.envVariables.zone"))
                         .build()))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    BuildSpec(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    BuildSpec(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static BuildSpec
    Use the contents of a local file as the build spec string.
    static BuildSpec
    fromObject(Map<String,? extends Object> value)
     
    static BuildSpec
    fromObjectToYaml(Map<String,? extends Object> value)
    Create a buildspec from an object that will be rendered as YAML in the resulting CloudFormation template.
    static BuildSpec
    Use a file from the source as buildspec.
    abstract Boolean
    Whether the buildspec is directly available or deferred until build-time.
    abstract String
    Render the represented BuildSpec.
    abstract String
    toBuildSpec(software.constructs.Construct scope)
    Render the represented BuildSpec.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • BuildSpec

      protected BuildSpec(software.amazon.jsii.JsiiObjectRef objRef)
    • BuildSpec

      protected BuildSpec(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • BuildSpec

      @Stability(Stable) protected BuildSpec()
  • Method Details

    • fromAsset

      @Stability(Stable) @NotNull public static BuildSpec fromAsset(@NotNull String path)
      Use the contents of a local file as the build spec string.

      Use this if you have a local .yml or .json file that you want to use as the buildspec

      Parameters:
      path - This parameter is required.
    • fromObject

      @Stability(Stable) @NotNull public static BuildSpec fromObject(@NotNull Map<String,? extends Object> value)
      Parameters:
      value - This parameter is required.
    • fromObjectToYaml

      @Stability(Stable) @NotNull public static BuildSpec fromObjectToYaml(@NotNull Map<String,? extends Object> value)
      Create a buildspec from an object that will be rendered as YAML in the resulting CloudFormation template.

      Parameters:
      value - the object containing the buildspec that will be rendered as YAML. This parameter is required.
    • fromSourceFilename

      @Stability(Stable) @NotNull public static BuildSpec fromSourceFilename(@NotNull String filename)
      Use a file from the source as buildspec.

      Use this if you want to use a file different from 'buildspec.yml'`

      Parameters:
      filename - This parameter is required.
    • toBuildSpec

      @Stability(Stable) @NotNull public abstract String toBuildSpec(@Nullable software.constructs.Construct scope)
      Render the represented BuildSpec.

      Parameters:
      scope -
    • toBuildSpec

      @Stability(Stable) @NotNull public abstract String toBuildSpec()
      Render the represented BuildSpec.
    • getIsImmediate

      @Stability(Stable) @NotNull public abstract Boolean getIsImmediate()
      Whether the buildspec is directly available or deferred until build-time.