CdkPipeline

class aws_cdk.pipelines.CdkPipeline(scope, id, *, cloud_assembly_artifact, cdk_cli_version=None, code_pipeline=None, cross_account_keys=None, pipeline_name=None, self_mutating=None, source_action=None, subnet_selection=None, synth_action=None, vpc=None)

Bases: aws_cdk.core.Construct

(experimental) A Pipeline to deploy CDK apps.

Defines an AWS CodePipeline-based Pipeline to deploy CDK applications.

Automatically manages the following:

  • Stack dependency order.

  • Asset publishing.

  • Keeping the pipeline up-to-date as the CDK apps change.

  • Using stack outputs later on in the pipeline.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • cloud_assembly_artifact (Artifact) – (experimental) The artifact you have defined to be the artifact to hold the cloudAssemblyArtifact for the synth action.

  • cdk_cli_version (Optional[str]) – (experimental) CDK CLI version to use in pipeline. Some Actions in the pipeline will download and run a version of the CDK CLI. Specify the version here. Default: - Latest version

  • code_pipeline (Optional[Pipeline]) – (experimental) Existing CodePipeline to add deployment stages to. Use this if you want more control over the CodePipeline that gets created. You can choose to not pass this value, in which case a new CodePipeline is created with default settings. If you pass an existing CodePipeline, it should should have been created with restartExecutionOnUpdate: true. [disable-awslint:ref-via-interface] Default: - A new CodePipeline is automatically generated

  • cross_account_keys (Optional[bool]) – (experimental) Create KMS keys for cross-account deployments. This controls whether the pipeline is enabled for cross-account deployments. Can only be set if codePipeline is not set. 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

  • pipeline_name (Optional[str]) – (experimental) Name of the pipeline. Can only be set if codePipeline is not set. Default: - A name is automatically generated

  • self_mutating (Optional[bool]) – (experimental) Whether the pipeline will update itself. This needs to be set to true to allow the pipeline to reconfigure itself when assets or stages are being added to it, and true is the recommended setting. You can temporarily set this to false while you are iterating on the pipeline itself and prefer to deploy changes using cdk deploy. Default: true

  • source_action (Optional[IAction]) – (experimental) The CodePipeline action used to retrieve the CDK app’s source. Default: - Required unless codePipeline is given

  • subnet_selection (Optional[SubnetSelection]) – (experimental) Which subnets to use. Only used if ‘vpc’ is supplied. Default: - All private subnets.

  • synth_action (Optional[IAction]) – (experimental) The CodePipeline action build and synthesis step of the CDK app. Default: - Required unless codePipeline or sourceAction is given

  • vpc (Optional[IVpc]) – (experimental) The VPC where to execute the CdkPipeline actions. Default: - No VPC

Stability

experimental

Methods

add_application_stage(app_stage, *, extra_run_order_space=None, manual_approvals=None)

(experimental) Add pipeline stage that will deploy the given application stage.

The application construct should subclass Stage and can contain any number of Stacks inside it that may have dependency relationships on one another.

All stacks in the application will be deployed in the appropriate order, and all assets found in the application will be added to the asset publishing stage.

Parameters
  • app_stage (Stage) –

  • extra_run_order_space (Union[int, float, None]) – (experimental) Add room for extra actions. You can use this to make extra room in the runOrder sequence between the changeset ‘prepare’ and ‘execute’ actions and insert your own actions there. Default: 0

  • manual_approvals (Optional[bool]) – (experimental) Add manual approvals before executing change sets. This gives humans the opportunity to confirm the change set looks alright before deploying it. Default: false

Stability

experimental

Return type

CdkStage

add_stage(stage_name)

(experimental) Add a new, empty stage to the pipeline.

Prefer to use addApplicationStage if you are intended to deploy a CDK application, but you can use this method if you want to add other kinds of Actions to a pipeline.

Parameters

stage_name (str) –

Stability

experimental

Return type

CdkStage

stack_output(cfn_output)

(experimental) Get the StackOutput object that holds this CfnOutput’s value in this pipeline.

StackOutput can be used in validation actions later in the pipeline.

Parameters

cfn_output (CfnOutput) –

Stability

experimental

Return type

StackOutput

stage(stage_name)

(experimental) Access one of the pipeline’s stages by stage name.

You can use this to add more Actions to a stage.

Parameters

stage_name (str) –

Stability

experimental

Return type

IStage

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

code_pipeline

(experimental) The underlying CodePipeline object.

You can use this to add more Stages to the pipeline, or Actions to Stages.

Stability

experimental

Return type

Pipeline

node

The construct tree node associated with this construct.

Return type

ConstructNode

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool