Class Stage
An abstract application modeling unit consisting of Stacks that should be deployed together.
Namespace: Amazon.CDK
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class Stage : Construct
Syntax (vb)
Public Class Stage Inherits Construct
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
Examples
CodePipeline pipeline;
var preprod = new MyApplicationStage(this, "PreProd");
var prod = new MyApplicationStage(this, "Prod");
pipeline.AddStage(preprod, new AddStageOpts {
Post = new [] {
new ShellStep("Validate Endpoint", new ShellStepProps {
Commands = new [] { "curl -Ssf https://my.webservice.com/" }
}) }
});
pipeline.AddStage(prod, new AddStageOpts {
Pre = new [] { new ManualApprovalStep("PromoteToProd") }
});
Synopsis
Constructors
Stage(Construct, string, IStageProps?) | An abstract application modeling unit consisting of Stacks that should be deployed together. |
Properties
Account | The default account for all resources defined within this stage. |
ArtifactId | Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string. |
AssetOutdir | The cloud assembly asset output directory. |
Outdir | The cloud assembly output directory. |
ParentStage | The parent stage or |
PolicyValidationBeta1 | Validation plugins to run during synthesis. |
Region | The default region for all resources defined within this stage. |
StageName | The name of the stage. |
Methods
IsStage(object) | Test whether the given construct is a stage. |
Of(IConstruct) | Return the stage this construct is contained with, if available. |
Synth(IStageSynthesisOptions?) | Synthesize this stage into a cloud assembly. |
Constructors
Stage(Construct, string, IStageProps?)
An abstract application modeling unit consisting of Stacks that should be deployed together.
public Stage(Construct scope, string id, IStageProps? props = null)
Parameters
- scope Construct
- id string
- props IStageProps
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
Examples
CodePipeline pipeline;
var preprod = new MyApplicationStage(this, "PreProd");
var prod = new MyApplicationStage(this, "Prod");
pipeline.AddStage(preprod, new AddStageOpts {
Post = new [] {
new ShellStep("Validate Endpoint", new ShellStepProps {
Commands = new [] { "curl -Ssf https://my.webservice.com/" }
}) }
});
pipeline.AddStage(prod, new AddStageOpts {
Pre = new [] { new ManualApprovalStep("PromoteToProd") }
});
Properties
Account
The default account for all resources defined within this stage.
public virtual string? Account { get; }
Property Value
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
ArtifactId
Artifact ID of the assembly if it is a nested stage. The root stage (app) will return an empty string.
public virtual string ArtifactId { get; }
Property Value
Remarks
Derived from the construct path.
AssetOutdir
The cloud assembly asset output directory.
public virtual string AssetOutdir { get; }
Property Value
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
Outdir
The cloud assembly output directory.
public virtual string Outdir { get; }
Property Value
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
ParentStage
The parent stage or undefined
if this is the app.
public virtual Stage? ParentStage { get; }
Property Value
Remarks
PolicyValidationBeta1
Validation plugins to run during synthesis.
public virtual IPolicyValidationPluginBeta1[] PolicyValidationBeta1 { get; }
Property Value
IPolicyValidationPluginBeta1[]
Remarks
If any plugin reports any violation, synthesis will be interrupted and the report displayed to the user.
Default: - no validation plugins are used
Region
The default region for all resources defined within this stage.
public virtual string? Region { get; }
Property Value
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
StageName
The name of the stage.
public virtual string StageName { get; }
Property Value
Remarks
Based on names of the parent stages separated by hypens.
Methods
IsStage(object)
Test whether the given construct is a stage.
public static bool IsStage(object x)
Parameters
- x object
Returns
Remarks
Derive a subclass of Stage
and use it to model a single instance of your
application.
You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.
ExampleMetadata: infused
Of(IConstruct)
Return the stage this construct is contained with, if available.
public static Stage? Of(IConstruct construct)
Parameters
- construct IConstruct
Returns
Remarks
If called on a nested stage, returns its parent.
Synth(IStageSynthesisOptions?)
Synthesize this stage into a cloud assembly.
public virtual CloudAssembly Synth(IStageSynthesisOptions? options = null)
Parameters
- options IStageSynthesisOptions
Returns
Remarks
Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.