Class Pipeline.Builder

java.lang.Object
software.amazon.awscdk.services.codepipeline.Pipeline.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<Pipeline>
Enclosing class:
Pipeline

@Stability(Stable) public static final class Pipeline.Builder extends Object implements software.amazon.jsii.Builder<Pipeline>
A fluent builder for Pipeline.
  • Method Details

    • create

      @Stability(Stable) public static Pipeline.Builder create(software.constructs.Construct scope, String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      Returns:
      a new instance of Pipeline.Builder.
    • artifactBucket

      @Stability(Stable) public Pipeline.Builder artifactBucket(IBucket artifactBucket)
      The S3 bucket used by this Pipeline to store artifacts.

      Default: - A new S3 bucket will be created.

      Parameters:
      artifactBucket - The S3 bucket used by this Pipeline to store artifacts. This parameter is required.
      Returns:
      this
    • crossAccountKeys

      @Stability(Stable) public Pipeline.Builder crossAccountKeys(Boolean crossAccountKeys)
      Create KMS keys for cross-account deployments.

      This controls whether the pipeline is enabled for cross-account deployments.

      By default cross-account deployments are enabled, but this feature requires that KMS Customer Master Keys are created which have a cost of $1/month.

      If you do not need cross-account deployments, you can set this to false to not create those keys and save on that cost (the artifact bucket will be encrypted with an AWS-managed key). However, cross-account deployments will no longer be possible.

      Default: false - false if the feature flag `CODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE` is true, true otherwise

      Parameters:
      crossAccountKeys - Create KMS keys for cross-account deployments. This parameter is required.
      Returns:
      this
    • crossRegionReplicationBuckets

      @Stability(Stable) public Pipeline.Builder crossRegionReplicationBuckets(Map<String,? extends IBucket> crossRegionReplicationBuckets)
      A map of region to S3 bucket name used for cross-region CodePipeline.

      For every Action that you specify targeting a different region than the Pipeline itself, if you don't provide an explicit Bucket for that region using this property, the construct will automatically create a Stack containing an S3 Bucket in that region.

      Default: - None.

      Parameters:
      crossRegionReplicationBuckets - A map of region to S3 bucket name used for cross-region CodePipeline. This parameter is required.
      Returns:
      this
    • enableKeyRotation

      @Stability(Stable) public Pipeline.Builder enableKeyRotation(Boolean enableKeyRotation)
      Enable KMS key rotation for the generated KMS keys.

      By default KMS key rotation is disabled, but will add an additional $1/month for each year the key exists when enabled.

      Default: - false (key rotation is disabled)

      Parameters:
      enableKeyRotation - Enable KMS key rotation for the generated KMS keys. This parameter is required.
      Returns:
      this
    • executionMode

      @Stability(Stable) public Pipeline.Builder executionMode(ExecutionMode executionMode)
      The method that the pipeline will use to handle multiple executions.

      Default: - ExecutionMode.SUPERSEDED

      Parameters:
      executionMode - The method that the pipeline will use to handle multiple executions. This parameter is required.
      Returns:
      this
    • pipelineName

      @Stability(Stable) public Pipeline.Builder pipelineName(String pipelineName)
      Name of the pipeline.

      Default: - AWS CloudFormation generates an ID and uses that for the pipeline name.

      Parameters:
      pipelineName - Name of the pipeline. This parameter is required.
      Returns:
      this
    • pipelineType

      @Stability(Stable) public Pipeline.Builder pipelineType(PipelineType pipelineType)
      Type of the pipeline.

      Default: - PipelineType.V2 if the feature flag `CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2` is true, PipelineType.V1 otherwise

      Parameters:
      pipelineType - Type of the pipeline. This parameter is required.
      Returns:
      this
      See Also:
    • restartExecutionOnUpdate

      @Stability(Stable) public Pipeline.Builder restartExecutionOnUpdate(Boolean restartExecutionOnUpdate)
      Indicates whether to rerun the AWS CodePipeline pipeline after you update it.

      Default: false

      Parameters:
      restartExecutionOnUpdate - Indicates whether to rerun the AWS CodePipeline pipeline after you update it. This parameter is required.
      Returns:
      this
    • reuseCrossRegionSupportStacks

      @Stability(Stable) public Pipeline.Builder reuseCrossRegionSupportStacks(Boolean reuseCrossRegionSupportStacks)
      Reuse the same cross region support stack for all pipelines in the App.

      Default: - true (Use the same support stack for all pipelines in App)

      Parameters:
      reuseCrossRegionSupportStacks - Reuse the same cross region support stack for all pipelines in the App. This parameter is required.
      Returns:
      this
    • role

      @Stability(Stable) public Pipeline.Builder role(IRole role)
      The IAM role to be assumed by this Pipeline.

      Default: a new IAM role will be created.

      Parameters:
      role - The IAM role to be assumed by this Pipeline. This parameter is required.
      Returns:
      this
    • stages

      @Stability(Stable) public Pipeline.Builder stages(List<? extends StageProps> stages)
      The list of Stages, in order, to create this Pipeline with.

      You can always add more Stages later by calling Pipeline#addStage.

      Default: - None.

      Parameters:
      stages - The list of Stages, in order, to create this Pipeline with. This parameter is required.
      Returns:
      this
    • triggers

      @Stability(Stable) public Pipeline.Builder triggers(List<? extends TriggerProps> triggers)
      The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline.

      When a trigger configuration is specified, default change detection for repository and branch commits is disabled.

      triggers can only be used when pipelineType is set to PipelineType.V2. You can always add more triggers later by calling Pipeline#addTrigger.

      Default: - No triggers

      Parameters:
      triggers - The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline. This parameter is required.
      Returns:
      this
    • variables

      @Stability(Stable) public Pipeline.Builder variables(List<? extends Variable> variables)
      A list that defines the pipeline variables for a pipeline resource.

      variables can only be used when pipelineType is set to PipelineType.V2. You can always add more variables later by calling Pipeline#addVariable.

      Default: - No variables

      Parameters:
      variables - A list that defines the pipeline variables for a pipeline resource. This parameter is required.
      Returns:
      this
    • build

      @Stability(Stable) public Pipeline build()
      Specified by:
      build in interface software.amazon.jsii.Builder<Pipeline>
      Returns:
      a newly built instance of Pipeline.