class Stage (construct)
An abstract application modeling unit consisting of Stacks that should be deployed together.
Derive a subclass of
Stage and use it to model a single instance of your
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
new Stage(scope: Construct, id: string, props?: StageProps)
|env?||Default AWS environment (account/region) for |
|outdir?||The output directory into which to emit synthesized artifacts.|
(optional, default: The environments should be configured on the
Default AWS environment (account/region) for
Stacks in this
Stacks defined inside this
Stage with either
from its env will use the corresponding field given here.
accountis is not configured for
Stack (either on
Stack itself or on the containing
Stage), the Stack will be
Environment-agnostic stacks can be deployed to any environment, may not be able to take advantage of all features of the CDK. For example, they will not be able to use environmental context lookups, will not automatically translate Service Principals to the right format based on the environment's AWS partition, and other such enhancements.
(optional, default: for nested stages, outdir will be determined as a relative
directory to the outdir of the app. For apps, if outdir is not specified, a
temporary directory will be created.)
The output directory into which to emit synthesized artifacts.
Can only be specified if this stage is the root stage (the app). If this is specified and this stage is nested within another stage, an error will be thrown.
|artifact||Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.|
|node||The construct tree node associated with this construct.|
|outdir||The cloud assembly output directory.|
|stage||The name of the stage.|
|account?||The default account for all resources defined within this stage.|
|parent||The parent stage or |
|region?||The default region for all resources defined within this stage.|
Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.
Derived from the construct path.
The construct tree node associated with this construct.
The cloud assembly output directory.
The name of the stage.
Based on names of the parent stages separated by hypens.
The default account for all resources defined within this stage.
The parent stage or
undefined if this is the app.
The default region for all resources defined within this stage.
|synth(options?)||Synthesize this stage into a cloud assembly.|
|to||Returns a string representation of this construct.|
|static is||Test whether the given construct is a stage.|
|static of(construct)||Return the stage this construct is contained with, if available.|
public synth(options?: StageSynthesisOptions): CloudAssembly
Synthesize this stage into a cloud assembly.
Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.
public toString(): string
Returns a string representation of this construct.
public static isStage(x: any): boolean
Test whether the given construct is a stage.
public static of(construct: IConstruct): Stage
Return the stage this construct is contained with, if available.
If called on a nested stage, returns its parent.