Interface Build.Builder

    • Method Detail

      • id

        Build.Builder id​(String id)

        The unique ID for the build.

        Parameters:
        id - The unique ID for the build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • arn

        Build.Builder arn​(String arn)

        The Amazon Resource Name (ARN) of the build.

        Parameters:
        arn - The Amazon Resource Name (ARN) of the build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • buildNumber

        Build.Builder buildNumber​(Long buildNumber)

        The number of the build. For each project, the buildNumber of its first build is 1. The buildNumber of each subsequent build is incremented by 1. If a build is deleted, the buildNumber of other builds does not change.

        Parameters:
        buildNumber - The number of the build. For each project, the buildNumber of its first build is 1. The buildNumber of each subsequent build is incremented by 1 . If a build is deleted, the buildNumber of other builds does not change.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • startTime

        Build.Builder startTime​(Instant startTime)

        When the build process started, expressed in Unix time format.

        Parameters:
        startTime - When the build process started, expressed in Unix time format.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • endTime

        Build.Builder endTime​(Instant endTime)

        When the build process ended, expressed in Unix time format.

        Parameters:
        endTime - When the build process ended, expressed in Unix time format.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • currentPhase

        Build.Builder currentPhase​(String currentPhase)

        The current build phase.

        Parameters:
        currentPhase - The current build phase.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • buildStatus

        Build.Builder buildStatus​(String buildStatus)

        The current status of the build. Valid values include:

        • FAILED: The build failed.

        • FAULT: The build faulted.

        • IN_PROGRESS: The build is still in progress.

        • STOPPED: The build stopped.

        • SUCCEEDED: The build succeeded.

        • TIMED_OUT: The build timed out.

        Parameters:
        buildStatus - The current status of the build. Valid values include:

        • FAILED: The build failed.

        • FAULT: The build faulted.

        • IN_PROGRESS: The build is still in progress.

        • STOPPED: The build stopped.

        • SUCCEEDED: The build succeeded.

        • TIMED_OUT: The build timed out.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        StatusType, StatusType
      • buildStatus

        Build.Builder buildStatus​(StatusType buildStatus)

        The current status of the build. Valid values include:

        • FAILED: The build failed.

        • FAULT: The build faulted.

        • IN_PROGRESS: The build is still in progress.

        • STOPPED: The build stopped.

        • SUCCEEDED: The build succeeded.

        • TIMED_OUT: The build timed out.

        Parameters:
        buildStatus - The current status of the build. Valid values include:

        • FAILED: The build failed.

        • FAULT: The build faulted.

        • IN_PROGRESS: The build is still in progress.

        • STOPPED: The build stopped.

        • SUCCEEDED: The build succeeded.

        • TIMED_OUT: The build timed out.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        StatusType, StatusType
      • sourceVersion

        Build.Builder sourceVersion​(String sourceVersion)

        Any version identifier for the version of the source code to be built. If sourceVersion is specified at the project level, then this sourceVersion (at the build level) takes precedence.

        For more information, see Source Version Sample with CodeBuild in the CodeBuild User Guide.

        Parameters:
        sourceVersion - Any version identifier for the version of the source code to be built. If sourceVersion is specified at the project level, then this sourceVersion (at the build level) takes precedence.

        For more information, see Source Version Sample with CodeBuild in the CodeBuild User Guide.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • resolvedSourceVersion

        Build.Builder resolvedSourceVersion​(String resolvedSourceVersion)

        An identifier for the version of this build's source code.

        • For CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit ID.

        • For CodePipeline, the source revision provided by CodePipeline.

        • For Amazon S3, this does not apply.

        Parameters:
        resolvedSourceVersion - An identifier for the version of this build's source code.

        • For CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit ID.

        • For CodePipeline, the source revision provided by CodePipeline.

        • For Amazon S3, this does not apply.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • projectName

        Build.Builder projectName​(String projectName)

        The name of the CodeBuild project.

        Parameters:
        projectName - The name of the CodeBuild project.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • phases

        Build.Builder phases​(Collection<BuildPhase> phases)

        Information about all previous build phases that are complete and information about any current build phase that is not yet complete.

        Parameters:
        phases - Information about all previous build phases that are complete and information about any current build phase that is not yet complete.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • phases

        Build.Builder phases​(BuildPhase... phases)

        Information about all previous build phases that are complete and information about any current build phase that is not yet complete.

        Parameters:
        phases - Information about all previous build phases that are complete and information about any current build phase that is not yet complete.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • phases

        Build.Builder phases​(Consumer<BuildPhase.Builder>... phases)

        Information about all previous build phases that are complete and information about any current build phase that is not yet complete.

        This is a convenience method that creates an instance of the BuildPhase.Builder avoiding the need to create one manually via BuildPhase.builder().

        When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to #phases(List).

        Parameters:
        phases - a consumer that will call methods on BuildPhase.Builder
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        #phases(java.util.Collection)
      • source

        Build.Builder source​(ProjectSource source)

        Information about the source code to be built.

        Parameters:
        source - Information about the source code to be built.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondarySources

        Build.Builder secondarySources​(Collection<ProjectSource> secondarySources)

        An array of ProjectSource objects.

        Parameters:
        secondarySources - An array of ProjectSource objects.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondarySources

        Build.Builder secondarySources​(ProjectSource... secondarySources)

        An array of ProjectSource objects.

        Parameters:
        secondarySources - An array of ProjectSource objects.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondarySourceVersions

        Build.Builder secondarySourceVersions​(Collection<ProjectSourceVersion> secondarySourceVersions)

        An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

        • For CodeCommit: the commit ID, branch, or Git tag to use.

        • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

        Parameters:
        secondarySourceVersions - An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

        • For CodeCommit: the commit ID, branch, or Git tag to use.

        • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondarySourceVersions

        Build.Builder secondarySourceVersions​(ProjectSourceVersion... secondarySourceVersions)

        An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

        • For CodeCommit: the commit ID, branch, or Git tag to use.

        • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

        Parameters:
        secondarySourceVersions - An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

        • For CodeCommit: the commit ID, branch, or Git tag to use.

        • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondarySourceVersions

        Build.Builder secondarySourceVersions​(Consumer<ProjectSourceVersion.Builder>... secondarySourceVersions)

        An array of ProjectSourceVersion objects. Each ProjectSourceVersion must be one of:

        • For CodeCommit: the commit ID, branch, or Git tag to use.

        • For GitHub: the commit ID, pull request ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a pull request ID is specified, it must use the format pr/pull-request-ID (for example, pr/25). If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Bitbucket: the commit ID, branch name, or tag name that corresponds to the version of the source code you want to build. If a branch name is specified, the branch's HEAD commit ID is used. If not specified, the default branch's HEAD commit ID is used.

        • For Amazon S3: the version ID of the object that represents the build input ZIP file to use.

        This is a convenience method that creates an instance of the ProjectSourceVersion.Builder avoiding the need to create one manually via ProjectSourceVersion.builder().

        When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to #secondarySourceVersions(List).

        Parameters:
        secondarySourceVersions - a consumer that will call methods on ProjectSourceVersion.Builder
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        #secondarySourceVersions(java.util.Collection)
      • artifacts

        Build.Builder artifacts​(BuildArtifacts artifacts)

        Information about the output artifacts for the build.

        Parameters:
        artifacts - Information about the output artifacts for the build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondaryArtifacts

        Build.Builder secondaryArtifacts​(Collection<BuildArtifacts> secondaryArtifacts)

        An array of ProjectArtifacts objects.

        Parameters:
        secondaryArtifacts - An array of ProjectArtifacts objects.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • secondaryArtifacts

        Build.Builder secondaryArtifacts​(BuildArtifacts... secondaryArtifacts)

        An array of ProjectArtifacts objects.

        Parameters:
        secondaryArtifacts - An array of ProjectArtifacts objects.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • cache

        Build.Builder cache​(ProjectCache cache)

        Information about the cache for the build.

        Parameters:
        cache - Information about the cache for the build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • environment

        Build.Builder environment​(ProjectEnvironment environment)

        Information about the build environment for this build.

        Parameters:
        environment - Information about the build environment for this build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • serviceRole

        Build.Builder serviceRole​(String serviceRole)

        The name of a service role used for this build.

        Parameters:
        serviceRole - The name of a service role used for this build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • logs

        Build.Builder logs​(LogsLocation logs)

        Information about the build's logs in CloudWatch Logs.

        Parameters:
        logs - Information about the build's logs in CloudWatch Logs.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • timeoutInMinutes

        Build.Builder timeoutInMinutes​(Integer timeoutInMinutes)

        How long, in minutes, for CodeBuild to wait before timing out this build if it does not get marked as completed.

        Parameters:
        timeoutInMinutes - How long, in minutes, for CodeBuild to wait before timing out this build if it does not get marked as completed.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • queuedTimeoutInMinutes

        Build.Builder queuedTimeoutInMinutes​(Integer queuedTimeoutInMinutes)

        The number of minutes a build is allowed to be queued before it times out.

        Parameters:
        queuedTimeoutInMinutes - The number of minutes a build is allowed to be queued before it times out.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • buildComplete

        Build.Builder buildComplete​(Boolean buildComplete)

        Whether the build is complete. True if complete; otherwise, false.

        Parameters:
        buildComplete - Whether the build is complete. True if complete; otherwise, false.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • initiator

        Build.Builder initiator​(String initiator)

        The entity that started the build. Valid values include:

        • If CodePipeline started the build, the pipeline's name (for example, codepipeline/my-demo-pipeline).

        • If a user started the build, the user's name (for example, MyUserName).

        • If the Jenkins plugin for CodeBuild started the build, the string CodeBuild-Jenkins-Plugin.

        Parameters:
        initiator - The entity that started the build. Valid values include:

        • If CodePipeline started the build, the pipeline's name (for example, codepipeline/my-demo-pipeline).

        • If a user started the build, the user's name (for example, MyUserName).

        • If the Jenkins plugin for CodeBuild started the build, the string CodeBuild-Jenkins-Plugin.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • vpcConfig

        Build.Builder vpcConfig​(VpcConfig vpcConfig)

        If your CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs. The security groups and subnets must belong to the same VPC. You must provide at least one security group and one subnet ID.

        Parameters:
        vpcConfig - If your CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs. The security groups and subnets must belong to the same VPC. You must provide at least one security group and one subnet ID.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • vpcConfig

        default Build.Builder vpcConfig​(Consumer<VpcConfig.Builder> vpcConfig)

        If your CodeBuild project accesses resources in an Amazon VPC, you provide this parameter that identifies the VPC ID and the list of security group IDs and subnet IDs. The security groups and subnets must belong to the same VPC. You must provide at least one security group and one subnet ID.

        This is a convenience method that creates an instance of the VpcConfig.Builder avoiding the need to create one manually via VpcConfig.builder().

        When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to vpcConfig(VpcConfig).

        Parameters:
        vpcConfig - a consumer that will call methods on VpcConfig.Builder
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        vpcConfig(VpcConfig)
      • networkInterface

        Build.Builder networkInterface​(NetworkInterface networkInterface)

        Describes a network interface.

        Parameters:
        networkInterface - Describes a network interface.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • encryptionKey

        Build.Builder encryptionKey​(String encryptionKey)

        The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.

        You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.

        You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format alias/<alias-name>).

        Parameters:
        encryptionKey - The Key Management Service customer master key (CMK) to be used for encrypting the build output artifacts.

        You can use a cross-account KMS key to encrypt the build output artifacts if your service role has permission to that key.

        You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, the CMK's alias (using the format alias/<alias-name>).

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • exportedEnvironmentVariables

        Build.Builder exportedEnvironmentVariables​(Collection<ExportedEnvironmentVariable> exportedEnvironmentVariables)

        A list of exported environment variables for this build.

        Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.

        Parameters:
        exportedEnvironmentVariables - A list of exported environment variables for this build.

        Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • exportedEnvironmentVariables

        Build.Builder exportedEnvironmentVariables​(ExportedEnvironmentVariable... exportedEnvironmentVariables)

        A list of exported environment variables for this build.

        Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.

        Parameters:
        exportedEnvironmentVariables - A list of exported environment variables for this build.

        Exported environment variables are used in conjunction with CodePipeline to export environment variables from the current build stage to subsequent stages in the pipeline. For more information, see Working with variables in the CodePipeline User Guide.

        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • reportArns

        Build.Builder reportArns​(Collection<String> reportArns)

        An array of the ARNs associated with this build's reports.

        Parameters:
        reportArns - An array of the ARNs associated with this build's reports.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • reportArns

        Build.Builder reportArns​(String... reportArns)

        An array of the ARNs associated with this build's reports.

        Parameters:
        reportArns - An array of the ARNs associated with this build's reports.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • fileSystemLocations

        Build.Builder fileSystemLocations​(Collection<ProjectFileSystemLocation> fileSystemLocations)

        An array of ProjectFileSystemLocation objects for a CodeBuild build project. A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.

        Parameters:
        fileSystemLocations - An array of ProjectFileSystemLocation objects for a CodeBuild build project. A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • fileSystemLocations

        Build.Builder fileSystemLocations​(ProjectFileSystemLocation... fileSystemLocations)

        An array of ProjectFileSystemLocation objects for a CodeBuild build project. A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.

        Parameters:
        fileSystemLocations - An array of ProjectFileSystemLocation objects for a CodeBuild build project. A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • fileSystemLocations

        Build.Builder fileSystemLocations​(Consumer<ProjectFileSystemLocation.Builder>... fileSystemLocations)

        An array of ProjectFileSystemLocation objects for a CodeBuild build project. A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, mountPoint, and type of a file system created using Amazon Elastic File System.

        This is a convenience method that creates an instance of the ProjectFileSystemLocation.Builder avoiding the need to create one manually via ProjectFileSystemLocation.builder().

        When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to #fileSystemLocations(List).

        Parameters:
        fileSystemLocations - a consumer that will call methods on ProjectFileSystemLocation.Builder
        Returns:
        Returns a reference to this object so that method calls can be chained together.
        See Also:
        #fileSystemLocations(java.util.Collection)
      • debugSession

        Build.Builder debugSession​(DebugSession debugSession)

        Contains information about the debug session for this build.

        Parameters:
        debugSession - Contains information about the debug session for this build.
        Returns:
        Returns a reference to this object so that method calls can be chained together.
      • buildBatchArn

        Build.Builder buildBatchArn​(String buildBatchArn)

        The ARN of the batch build that this build is a member of, if applicable.

        Parameters:
        buildBatchArn - The ARN of the batch build that this build is a member of, if applicable.
        Returns:
        Returns a reference to this object so that method calls can be chained together.