StackDeployment

class aws_cdk.pipelines.StackDeployment(*args: Any, **kwargs)

Bases: object

Deployment of a single Stack.

You don’t need to instantiate this class – it will be automatically instantiated as necessary when you add a Stage to a pipeline.

ExampleMetadata

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import cx_api
from aws_cdk import pipelines

# cloud_formation_stack_artifact: cx_api.CloudFormationStackArtifact

stack_deployment = pipelines.StackDeployment.from_artifact(cloud_formation_stack_artifact)

Methods

add_stack_dependency(stack_deployment)

Add a dependency on another stack.

Parameters

stack_deployment (StackDeployment) –

Return type

None

add_stack_steps(pre, change_set, post)

Adds steps to each phase of the stack.

Parameters
  • pre (Sequence[Step]) – steps executed before stack.prepare.

  • change_set (Sequence[Step]) – steps executed after stack.prepare and before stack.deploy.

  • post (Sequence[Step]) – steps executed after stack.deploy.

Return type

None

Attributes

absolute_template_path

Template path on disk to CloudAssembly.

Return type

str

account

Account where the stack should be deployed.

Default
  • Pipeline account

Return type

Optional[str]

assets

Assets referenced by this stack.

Return type

List[StackAsset]

assume_role_arn

Role to assume before deploying this stack.

Default
  • Don’t assume any role

Return type

Optional[str]

change_set

Steps that take place after stack is prepared but before stack deploys.

Your pipeline engine may not disable prepareStep.

Return type

List[Step]

construct_path

Construct path for this stack.

Return type

str

execution_role_arn

Execution role to pass to CloudFormation.

Default
  • No execution role

Return type

Optional[str]

post

Steps to execute after stack deploys.

Return type

List[Step]

pre

Steps that take place before stack is prepared.

If your pipeline engine disables ‘prepareStep’, then this will happen before stack deploys

Return type

List[Step]

region

Region where the stack should be deployed.

Default
  • Pipeline region

Return type

Optional[str]

stack_artifact_id

Artifact ID for this stack.

Return type

str

stack_dependencies

Other stacks this stack depends on.

Return type

List[StackDeployment]

stack_name

Name for this stack.

Return type

str

tags

Tags to apply to the stack.

Return type

Mapping[str, str]

template_asset

The asset that represents the CloudFormation template for this stack.

Return type

Optional[StackAsset]

template_url

The S3 URL which points to the template asset location in the publishing bucket.

This is undefined if the stack template is not published. Use the DefaultStackSynthesizer to ensure it is.

Example value: https://bucket.s3.amazonaws.com/object/key

Return type

Optional[str]

Static Methods

classmethod from_artifact(stack_artifact)

Build a StackDeployment from a Stack Artifact in a Cloud Assembly.

Parameters

stack_artifact (CloudFormationStackArtifact) –

Return type

StackDeployment