# StageDeployment

Deployment of a single `Stage`.

A `Stage` consists of one or more `Stacks`, which will be
deployed in dependency order.

- Source: [`pipelines/lib/blueprint/stage-deployment.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/pipelines/lib/blueprint/stage-deployment.ts#L49)
- Type last changed: v2.44.0 · 29 Sep 2022

## Example

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

declare const stack: cdk.Stack;
declare const stage: cdk.Stage;
declare const step: pipelines.Step;
const stageDeployment = pipelines.StageDeployment.fromStage(stage, /* all optional props */ {
  post: [step],
  pre: [step],
  stackSteps: [{
    stack: stack,

    // the properties below are optional
    changeSet: [step],
    post: [step],
    pre: [step],
  }],
  stageName: 'stageName',
});
```

## Properties

- `post`: [Step](/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Additional steps that are run after all of the stacks in the stage.

- `pre`: [Step](/cdk/api/v2/docs/aws-cdk-lib.pipelines.Step.html)[] — Additional steps that are run before any of the stacks in the stage.

- `prepareStep`: boolean — Determine if all stacks in stage should be deployed with prepare step or not.

- `stacks`: [StackDeployment](/cdk/api/v2/docs/aws-cdk-lib.pipelines.StackDeployment.html)[] — The stacks deployed in this stage.

- `stackSteps`: [StackSteps](/cdk/api/v2/docs/aws-cdk-lib.pipelines.StackSteps.html)[] — Instructions for additional steps that are run at stack level.

- `stageName`: string — The display name of this stage.

## Methods

- `addPost(...steps: Step[]): void` — Add an additional step to run after all of the stacks in this stage.

- `addPre(...steps: Step[]): void` — Add an additional step to run before any of the stacks in this stage.

- `fromStage(stage: Stage, props?: StageDeploymentProps): StageDeployment // chainable` (static) — Create a new `StageDeployment` from a `Stage`.

  Synthesizes the target stage, and deployes the stacks found inside
  in dependency order.
