PipelineProps

class aws_cdk.aws_codepipeline.PipelineProps(*, artifact_bucket=None, cross_account_keys=None, cross_region_replication_buckets=None, enable_key_rotation=None, pipeline_name=None, restart_execution_on_update=None, reuse_cross_region_support_stacks=None, role=None, stages=None)

Bases: object

Parameters:
  • artifact_bucket (Optional[IBucket]) – The S3 bucket used by this Pipeline to store artifacts. Default: - A new S3 bucket will be created.

  • cross_account_keys (Optional[bool]) – 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: true

  • cross_region_replication_buckets (Optional[Mapping[str, IBucket]]) – 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.

  • enable_key_rotation (Optional[bool]) – 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)

  • pipeline_name (Optional[str]) – Name of the pipeline. Default: - AWS CloudFormation generates an ID and uses that for the pipeline name.

  • restart_execution_on_update (Optional[bool]) – Indicates whether to rerun the AWS CodePipeline pipeline after you update it. Default: false

  • reuse_cross_region_support_stacks (Optional[bool]) – 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)

  • role (Optional[IRole]) – The IAM role to be assumed by this Pipeline. Default: a new IAM role will be created.

  • stages (Optional[Sequence[Union[StageProps, Dict[str, Any]]]]) – The list of Stages, in order, to create this Pipeline with. You can always add more Stages later by calling {@link Pipeline#addStage}. Default: - None.

ExampleMetadata:

infused

Example:

# project: codebuild.PipelineProject

repository = codecommit.Repository(self, "MyRepository",
    repository_name="MyRepository"
)
project = codebuild.PipelineProject(self, "MyProject")

source_output = codepipeline.Artifact()
source_action = codepipeline_actions.CodeCommitSourceAction(
    action_name="CodeCommit",
    repository=repository,
    output=source_output
)
build_action = codepipeline_actions.CodeBuildAction(
    action_name="CodeBuild",
    project=project,
    input=source_output,
    outputs=[codepipeline.Artifact()],  # optional
    execute_batch_build=True,  # optional, defaults to false
    combine_batch_build_artifacts=True
)

codepipeline.Pipeline(self, "MyPipeline",
    stages=[codepipeline.StageProps(
        stage_name="Source",
        actions=[source_action]
    ), codepipeline.StageProps(
        stage_name="Build",
        actions=[build_action]
    )
    ]
)

Attributes

artifact_bucket

The S3 bucket used by this Pipeline to store artifacts.

Default:
  • A new S3 bucket will be created.

cross_account_keys

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:

true

cross_region_replication_buckets

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.

enable_key_rotation

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)

pipeline_name

Name of the pipeline.

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

restart_execution_on_update

Indicates whether to rerun the AWS CodePipeline pipeline after you update it.

Default:

false

reuse_cross_region_support_stacks

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)

role

The IAM role to be assumed by this Pipeline.

Default:

a new IAM role will be created.

stages

The list of Stages, in order, to create this Pipeline with.

You can always add more Stages later by calling {@link Pipeline#addStage}.

Default:
  • None.