aws-cdk-lib.aws_codepipeline.PipelineProps

interface PipelineProps

LanguageType name
.NETAmazon.CDK.AWS.CodePipeline.PipelineProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline#PipelineProps
Javasoftware.amazon.awscdk.services.codepipeline.PipelineProps
Pythonaws_cdk.aws_codepipeline.PipelineProps
TypeScript (source)aws-cdk-lib » aws_codepipeline » PipelineProps

Example

declare const project: codebuild.PipelineProject;
const repository = new codecommit.Repository(this, 'MyRepository', {
  repositoryName: 'MyRepository',
});
const project = new codebuild.PipelineProject(this, 'MyProject');

const sourceOutput = new codepipeline.Artifact();
const sourceAction = new codepipeline_actions.CodeCommitSourceAction({
  actionName: 'CodeCommit',
  repository,
  output: sourceOutput,
});
const buildAction = new codepipeline_actions.CodeBuildAction({
  actionName: 'CodeBuild',
  project,
  input: sourceOutput,
  outputs: [new codepipeline.Artifact()], // optional
  executeBatchBuild: true, // optional, defaults to false
  combineBatchBuildArtifacts: true, // optional, defaults to false
});

new codepipeline.Pipeline(this, 'MyPipeline', {
  stages: [
    {
      stageName: 'Source',
      actions: [sourceAction],
    },
    {
      stageName: 'Build',
      actions: [buildAction],
    },
  ],
});

Properties

NameTypeDescription
artifactBucket?IBucketThe S3 bucket used by this Pipeline to store artifacts.
crossAccountKeys?booleanCreate KMS keys for cross-account deployments.
crossRegionReplicationBuckets?{ [string]: IBucket }A map of region to S3 bucket name used for cross-region CodePipeline.
enableKeyRotation?booleanEnable KMS key rotation for the generated KMS keys.
pipelineName?stringName of the pipeline.
restartExecutionOnUpdate?booleanIndicates whether to rerun the AWS CodePipeline pipeline after you update it.
reuseCrossRegionSupportStacks?booleanReuse the same cross region support stack for all pipelines in the App.
role?IRoleThe IAM role to be assumed by this Pipeline.
stages?StageProps[]The list of Stages, in order, to create this Pipeline with.

artifactBucket?

Type: IBucket (optional, default: A new S3 bucket will be created.)

The S3 bucket used by this Pipeline to store artifacts.


crossAccountKeys?

Type: boolean (optional, default: true)

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.


crossRegionReplicationBuckets?

Type: { [string]: IBucket } (optional, default: None.)

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.


enableKeyRotation?

Type: boolean (optional, default: false (key rotation is disabled))

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.


pipelineName?

Type: string (optional, default: AWS CloudFormation generates an ID and uses that for the pipeline name.)

Name of the pipeline.


restartExecutionOnUpdate?

Type: boolean (optional, default: false)

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


reuseCrossRegionSupportStacks?

Type: boolean (optional, default: true (Use the same support stack for all pipelines in App))

Reuse the same cross region support stack for all pipelines in the App.


role?

Type: IRole (optional, default: a new IAM role will be created.)

The IAM role to be assumed by this Pipeline.


stages?

Type: StageProps[] (optional, default: None.)

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

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