Skip to content
v2.275.0

StageDeployment Class ​

Deployment of a single Stage.

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

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 ​

postStep[]posttyping.List[Step]postList<Step>PostStep[]Post*[]Step#
Additional steps that are run after all of the stacks in the stage.
preStep[]pretyping.List[Step]preList<Step>PreStep[]Pre*[]Step#
Additional steps that are run before any of the stacks in the stage.
prepareStepmay be undefinedbooleanprepare_stepmay be undefinedboolprepareStepmay be undefinedBooleanPrepareStepmay be undefinedboolPrepareStepmay be undefined*bool#
Determine if all stacks in stage should be deployed with prepare step or not.
stacksStackDeployment[]stackstyping.List[StackDeployment]stacksList<StackDeployment>StacksStackDeployment[]Stacks*[]StackDeployment#
The stacks deployed in this stage.
stackStepsStackSteps[]stack_stepstyping.List[StackSteps]stackStepsList<StackSteps>StackStepsStackSteps[]StackSteps*[]StackSteps#
Instructions for additional steps that are run at stack level.
stageNamestringstage_namestrstageNameStringStageNamestringStageName*string#
The display name of this stage.

Methods ​

addPost(...steps: Step[]): voiddef add_post(self, steps: Step) -> Nonepublic void addPost(Step steps)public void AddPost(Step steps)func AddPost(Steps Step)#
Add an additional step to run after all of the stacks in this stage.
addPre(...steps: Step[]): voiddef add_pre(self, steps: Step) -> Nonepublic void addPre(Step steps)public void AddPre(Step steps)func AddPre(Steps Step)#
Add an additional step to run before any of the stacks in this stage.
fromStage(stage: Stage, props?: StageDeploymentProps): StageDeployment // chainable@staticmethod def from_stage(stage: Stage, props: typing.Optional[StageDeploymentProps] = None) -> StageDeploymentpublic static StageDeployment fromStage(Stage stage, StageDeploymentProps props)public static StageDeployment FromStage(Stage stage, StageDeploymentProps? props = null)func FromStage(Stage Stage, Props StageDeploymentProps) StageDeploymentstatic#
Create a new `StageDeployment` from a `Stage`.

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