# 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.

- Source: [`pipelines/lib/blueprint/stack-deployment.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/pipelines/lib/blueprint/stack-deployment.ts#L92)

## Example

```ts
// 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

- `absoluteTemplatePath`: string — Template path on disk to CloudAssembly.

- `account`: string — Account where the stack should be deployed.

  **Default:** Pipeline account

- `assets`: [StackAsset](/cdk/api/v2/docs/aws-cdk-lib.pipelines.StackAsset.html)[] — Assets referenced by this stack.

- `assumeRoleArn`: string — Role to assume before deploying this stack.

  **Default:** Don't assume any role

- `changeSet`: [Step](/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Steps that take place after stack is prepared but before stack deploys.

  Your pipeline engine may not disable `prepareStep`.

- `constructPath`: string — Construct path for this stack.

- `executionRoleArn`: string — Execution role to pass to CloudFormation.

  **Default:** No execution role

- `post`: [Step](/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Steps to execute after stack deploys.

- `pre`: [Step](/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Steps that take place before stack is prepared.

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

- `region`: string — Region where the stack should be deployed.

  **Default:** Pipeline region

- `stackArtifactId`: string — Artifact ID for this stack.

- `stackDependencies`: [StackDeployment](/cdk/api/v2/docs/aws-cdk-lib.pipelines.StackDeployment.html)[] — Other stacks this stack depends on.

- `stackName`: string — Name for this stack.

- `tags`: { [key: string]: string } — Tags to apply to the stack.

- `templateAsset`: [StackAsset](/cdk/api/v2/docs/aws-cdk-lib.pipelines.StackAsset.html) — The asset that represents the CloudFormation template for this stack.

- `templateUrl`: string — 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

- `addStackDependency(stackDeployment: StackDeployment): void` — Add a dependency on another stack.

- `addStackSteps(pre: Step[], changeSet: Step[], post: Step[]): void` — Adds steps to each phase of the stack.

  **Parameters**

  - `pre` — steps executed before stack.prepare.
  - `changeSet` — steps executed after stack.prepare and before stack.deploy.
  - `post` — steps executed after stack.deploy.

- `fromArtifact(stackArtifact: CloudFormationStackArtifact): StackDeployment // chainable` (static) — Build a `StackDeployment` from a Stack Artifact in a Cloud Assembly.
