aws-cdk-lib.pipelines.StackDeployment

class StackDeployment

LanguageType name
.NETAmazon.CDK.Pipelines.StackDeployment
Gogithub.com/aws/aws-cdk-go/awscdk/v2/pipelines#StackDeployment
Javasoftware.amazon.awscdk.pipelines.StackDeployment
Pythonaws_cdk.pipelines.StackDeployment
TypeScript (source)aws-cdk-lib » pipelines » StackDeployment

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.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { cx_api } from 'aws-cdk-lib';
import { pipelines } from 'aws-cdk-lib';

declare const cloudFormationStackArtifact: cx_api.CloudFormationStackArtifact;
const stackDeployment = pipelines.StackDeployment.fromArtifact(cloudFormationStackArtifact);

Properties

NameTypeDescription
absoluteTemplatePathstringTemplate path on disk to CloudAssembly.
assetsStackAsset[]Assets referenced by this stack.
changeSetStep[]Steps that take place after stack is prepared but before stack deploys.
constructPathstringConstruct path for this stack.
postStep[]Steps to execute after stack deploys.
preStep[]Steps that take place before stack is prepared.
stackArtifactIdstringArtifact ID for this stack.
stackDependenciesStackDeployment[]Other stacks this stack depends on.
stackNamestringName for this stack.
tags{ [string]: string }Tags to apply to the stack.
account?stringAccount where the stack should be deployed.
assumeRoleArn?stringRole to assume before deploying this stack.
executionRoleArn?stringExecution role to pass to CloudFormation.
region?stringRegion where the stack should be deployed.
templateAsset?StackAssetThe asset that represents the CloudFormation template for this stack.
templateUrl?stringThe S3 URL which points to the template asset location in the publishing bucket.

absoluteTemplatePath

Type: string

Template path on disk to CloudAssembly.


assets

Type: StackAsset[]

Assets referenced by this stack.


changeSet

Type: Step[]

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

Your pipeline engine may not disable prepareStep.


constructPath

Type: string

Construct path for this stack.


post

Type: Step[]

Steps to execute after stack deploys.


pre

Type: Step[]

Steps that take place before stack is prepared.

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


stackArtifactId

Type: string

Artifact ID for this stack.


stackDependencies

Type: StackDeployment[]

Other stacks this stack depends on.


stackName

Type: string

Name for this stack.


tags

Type: { [string]: string }

Tags to apply to the stack.


account?

Type: string (optional, default: Pipeline account)

Account where the stack should be deployed.


assumeRoleArn?

Type: string (optional, default: Don't assume any role)

Role to assume before deploying this stack.


executionRoleArn?

Type: string (optional, default: No execution role)

Execution role to pass to CloudFormation.


region?

Type: string (optional, default: Pipeline region)

Region where the stack should be deployed.


templateAsset?

Type: StackAsset (optional)

The asset that represents the CloudFormation template for this stack.


templateUrl?

Type: string (optional)

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

Methods

NameDescription
addStackDependency(stackDeployment)Add a dependency on another stack.
addStackSteps(pre, changeSet, post)Adds steps to each phase of the stack.
static fromArtifact(stackArtifact)Build a StackDeployment from a Stack Artifact in a Cloud Assembly.

addStackDependency(stackDeployment)

public addStackDependency(stackDeployment: StackDeployment): void

Parameters

  • stackDeployment StackDeployment

Add a dependency on another stack.


addStackSteps(pre, changeSet, post)

public addStackSteps(pre: Step[], changeSet: Step[], post: Step[]): void

Parameters

  • pre Step[] — steps executed before stack.prepare.
  • changeSet Step[] — steps executed after stack.prepare and before stack.deploy.
  • post Step[] — steps executed after stack.deploy.

Adds steps to each phase of the stack.


static fromArtifact(stackArtifact)

public static fromArtifact(stackArtifact: CloudFormationStackArtifact): StackDeployment

Parameters

  • stackArtifact CloudFormationStackArtifact

Returns

  • StackDeployment

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