CdkPipeline

class aws_cdk.pipelines.CdkPipeline(scope, id, *, cloud_assembly_artifact, asset_build_spec=None, asset_pre_install_commands=None, cdk_cli_version=None, code_pipeline=None, cross_account_keys=None, docker_credentials=None, enable_key_rotation=None, pipeline_name=None, self_mutating=None, self_mutation_build_spec=None, single_publisher_per_type=None, source_action=None, subnet_selection=None, support_docker_assets=None, synth_action=None, vpc=None)

Bases: Construct

(deprecated) 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.

Deprecated:

This class is part of the old API. Use the API based on the CodePipeline class instead

Stability:

deprecated

ExampleMetadata:

infused

Example:

source_artifact = codepipeline.Artifact()
cloud_assembly_artifact = codepipeline.Artifact()
pipeline = pipelines.CdkPipeline(self, "MyPipeline",
    cloud_assembly_artifact=cloud_assembly_artifact,
    synth_action=pipelines.SimpleSynthAction.standard_npm_synth(
        source_artifact=source_artifact,
        cloud_assembly_artifact=cloud_assembly_artifact,
        environment=codebuild.BuildEnvironment(
            privileged=True
        )
    )
)
Parameters:
  • scope (Construct) –

  • id (str) –

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

  • asset_build_spec (Optional[BuildSpec]) – (deprecated) Custom BuildSpec that is merged with generated one (for asset publishing actions). Default: - none

  • asset_pre_install_commands (Optional[Sequence[str]]) – (deprecated) Additional commands to run before installing cdk-assets during the asset publishing step Use this to setup proxies or npm mirrors. Default: -

  • cdk_cli_version (Optional[str]) – (deprecated) 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]) – (deprecated) 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 have been created with restartExecutionOnUpdate: true. [disable-awslint:ref-via-interface] Default: - A new CodePipeline is automatically generated

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

  • docker_credentials (Optional[Sequence[DockerCredential]]) – (deprecated) A list of credentials used to authenticate to Docker registries. Specify any credentials necessary within the pipeline to build, synth, update, or publish assets. Default: []

  • enable_key_rotation (Optional[bool]) – (deprecated) Enables KMS key rotation for cross-account keys. Cannot be set if crossAccountKeys was set to false. Key rotation costs $1/month when enabled. Default: - false (key rotation is disabled)

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

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

  • self_mutation_build_spec (Optional[BuildSpec]) – (deprecated) Custom BuildSpec that is merged with generated one (for self-mutation stage). Default: - none

  • single_publisher_per_type (Optional[bool]) – (deprecated) Whether this pipeline creates one asset upload action per asset type or one asset upload per asset. Default: false

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

  • subnet_selection (Union[SubnetSelection, Dict[str, Any], None]) – (deprecated) Which subnets to use. Only used if ‘vpc’ is supplied. Default: - All private subnets.

  • support_docker_assets (Optional[bool]) – (deprecated) Whether the pipeline needs to build Docker images in the UpdatePipeline stage. If the UpdatePipeline stage tries to build a Docker image and this flag is not set to true, the build step will run in non-privileged mode and consequently will fail with a message like: .. epigraph:: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? This flag has an effect only if selfMutating is also true. Default: - false

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

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

Stability:

deprecated

Methods

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

(deprecated) 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]) – (deprecated) 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]) – (deprecated) Add manual approvals before executing change sets. This gives humans the opportunity to confirm the change set looks alright before deploying it. Default: false

  • confirm_broadening_permissions (Optional[bool]) – (deprecated) Runs a cdk diff --security-only --fail to pause the pipeline if there are any security changes. If the stage is configured with confirmBroadeningPermissions enabled, you can use this property to override the stage configuration. For example, Pipeline Stage “Prod” has confirmBroadeningPermissions enabled, with applications “A”, “B”, “C”. All three applications will run a security check, but if we want to disable the one for “C”, we run stage.addApplication(C, { confirmBroadeningPermissions: false }) to override the pipeline stage behavior. Adds 1 to the run order space. Default: false

  • security_notification_topic (Optional[ITopic]) – (deprecated) Optional SNS topic to send notifications to when the security check registers changes within the application. Default: undefined no notification topic for security check manual approval action

Stability:

deprecated

Return type:

CdkStage

add_stage(stage_name, *, confirm_broadening_permissions=None, security_notification_topic=None)

(deprecated) 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) –

  • confirm_broadening_permissions (Optional[bool]) – (deprecated) Runs a cdk diff --security-only --fail to pause the pipeline if there are any security changes. If the stage is configured with confirmBroadeningPermissions enabled, you can use this property to override the stage configuration. For example, Pipeline Stage “Prod” has confirmBroadeningPermissions enabled, with applications “A”, “B”, “C”. All three applications will run a security check, but if we want to disable the one for “C”, we run stage.addApplication(C, { confirmBroadeningPermissions: false }) to override the pipeline stage behavior. Adds 1 to the run order space. Default: false

  • security_notification_topic (Optional[ITopic]) – (deprecated) Optional SNS topic to send notifications to when the security check registers changes within the application. Default: undefined no notification topic for security check manual approval action

Stability:

deprecated

Return type:

CdkStage

stack_output(cfn_output)

(deprecated) 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:

deprecated

Return type:

StackOutput

stage(stage_name)

(deprecated) 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:

deprecated

Return type:

IStage

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

code_pipeline

(deprecated) The underlying CodePipeline object.

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

Stability:

deprecated

node

The construct tree node associated with this construct.

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool