PipelineProps
- class aws_cdk.aws_codepipeline.PipelineProps(*, artifact_bucket=None, cross_account_keys=None, cross_region_replication_buckets=None, enable_key_rotation=None, execution_mode=None, pipeline_name=None, pipeline_type=None, restart_execution_on_update=None, reuse_cross_region_support_stacks=None, role=None, stages=None, triggers=None, variables=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 tofalse
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 flagCODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE
is true, true otherwisecross_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)execution_mode (
Optional
[ExecutionMode
]) – The method that the pipeline will use to handle multiple executions. Default: - ExecutionMode.SUPERSEDEDpipeline_name (
Optional
[str
]) – Name of the pipeline. Default: - AWS CloudFormation generates an ID and uses that for the pipeline name.pipeline_type (
Optional
[PipelineType
]) – Type of the pipeline. Default: - PipelineType.V2 if the feature flagCODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2
is true, PipelineType.V1 otherwiserestart_execution_on_update (
Optional
[bool
]) – Indicates whether to rerun the AWS CodePipeline pipeline after you update it. Default: falsereuse_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 callingPipeline#addStage
. Default: - None.triggers (
Optional
[Sequence
[Union
[TriggerProps
,Dict
[str
,Any
]]]]) – 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 whenpipelineType
is set toPipelineType.V2
. You can always add more triggers later by callingPipeline#addTrigger
. Default: - No triggersvariables (
Optional
[Sequence
[Variable
]]) – A list that defines the pipeline variables for a pipeline resource.variables
can only be used whenpipelineType
is set toPipelineType.V2
. You can always add more variables later by callingPipeline#addVariable
. Default: - No variables
- ExampleMetadata:
infused
Example:
# source_action: codepipeline_actions.S3SourceAction # source_output: codepipeline.Artifact # deploy_bucket: s3.Bucket # Pipeline-level variable variable = codepipeline.Variable( variable_name="bucket-var", description="description", default_value="sample" ) codepipeline.Pipeline(self, "Pipeline", pipeline_type=codepipeline.PipelineType.V2, variables=[variable], stages=[codepipeline.StageProps( stage_name="Source", actions=[source_action] ), codepipeline.StageProps( stage_name="Deploy", actions=[ codepipeline_actions.S3DeployAction( action_name="DeployAction", # can reference the variables object_key=f"{variable.reference()}.txt", input=source_output, bucket=deploy_bucket ) ] ) ] )
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:
false - false if the feature flag
CODEPIPELINE_CROSS_ACCOUNT_KEYS_DEFAULT_VALUE_TO_FALSE
is true, true otherwise
- 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)
- execution_mode
The method that the pipeline will use to handle multiple executions.
- Default:
ExecutionMode.SUPERSEDED
- pipeline_name
Name of the pipeline.
- Default:
AWS CloudFormation generates an ID and uses that for the pipeline name.
- pipeline_type
Type of the pipeline.
- Default:
PipelineType.V2 if the feature flag
CODEPIPELINE_DEFAULT_PIPELINE_TYPE_TO_V2
is true, PipelineType.V1 otherwise
- 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
Pipeline#addStage
.- Default:
None.
- 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 whenpipelineType
is set toPipelineType.V2
. You can always add more triggers later by callingPipeline#addTrigger
.- Default:
No triggers
- variables
A list that defines the pipeline variables for a pipeline resource.
variables
can only be used whenpipelineType
is set toPipelineType.V2
. You can always add more variables later by callingPipeline#addVariable
.- Default:
No variables