interface PipelineProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.CodePipeline.PipelineProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscodepipeline#PipelineProps |
Java | software.amazon.awscdk.services.codepipeline.PipelineProps |
Python | aws_cdk.aws_codepipeline.PipelineProps |
TypeScript (source) | aws-cdk-lib » aws_codepipeline » PipelineProps |
Example
declare const sourceAction: codepipeline_actions.S3SourceAction;
declare const sourceOutput: codepipeline.Artifact;
declare const deployBucket: s3.Bucket;
// Pipeline-level variable
const variable = new codepipeline.Variable({
variableName: 'bucket-var',
description: 'description',
defaultValue: 'sample',
});
new codepipeline.Pipeline(this, 'Pipeline', {
pipelineType: codepipeline.PipelineType.V2,
variables: [variable],
stages: [
{
stageName: 'Source',
actions: [sourceAction],
},
{
stageName: 'Deploy',
actions: [
new codepipeline_actions.S3DeployAction({
actionName: 'DeployAction',
// can reference the variables
objectKey: `${variable.reference()}.txt`,
input: sourceOutput,
bucket: deployBucket,
}),
],
},
],
});
Properties
Name | Type | Description |
---|---|---|
artifact | IBucket | The S3 bucket used by this Pipeline to store artifacts. |
cross | boolean | Create KMS keys for cross-account deployments. |
cross | { [string]: IBucket } | A map of region to S3 bucket name used for cross-region CodePipeline. |
enable | boolean | Enable KMS key rotation for the generated KMS keys. |
execution | Execution | The method that the pipeline will use to handle multiple executions. |
pipeline | string | Name of the pipeline. |
pipeline | Pipeline | Type of the pipeline. |
restart | boolean | Indicates whether to rerun the AWS CodePipeline pipeline after you update it. |
reuse | boolean | Reuse the same cross region support stack for all pipelines in the App. |
role? | IRole | The IAM role to be assumed by this Pipeline. |
stages? | Stage [] | The list of Stages, in order, to create this Pipeline with. |
triggers? | Trigger [] | The trigger configuration specifying a type of event, such as Git tags, that starts the pipeline. |
variables? | Variable [] | A list that defines the pipeline variables for a pipeline resource. |
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: false - false if the feature flag CODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE
is true, true otherwise)
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.
executionMode?
Type:
Execution
(optional, default: ExecutionMode.SUPERSEDED)
The method that the pipeline will use to handle multiple executions.
pipelineName?
Type:
string
(optional, default: AWS CloudFormation generates an ID and uses that for the pipeline name.)
Name of the pipeline.
pipelineType?
Type:
Pipeline
(optional, default: PipelineType.V2 if the feature flag CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2
is true, PipelineType.V1 otherwise)
Type 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:
Stage
[]
(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
.
triggers?
Type:
Trigger
[]
(optional, default: No 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
.
variables?
Type:
Variable
[]
(optional, default: No 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
.