Class Stage
An abstract application modeling unit consisting of Stacks that should be deployed together.
Inherited Members
Namespace: Amazon.CDK
Assembly: Amazon.CDK.dll
Syntax (csharp)
public class Stage : Construct, IConstruct, IDependable
Syntax (vb)
Public Class Stage
Inherits Construct
Implements IConstruct, IDependable
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;
class MyOutputStage : Stage
{
public CfnOutput LoadBalancerAddress { get; }
public MyOutputStage(Construct scope, string id, StageProps? props=null) : base(scope, id, props)
{
LoadBalancerAddress = new CfnOutput(this, "Output", new CfnOutputProps { Value = "value" });
}
}
var lbApp = new MyOutputStage(this, "MyApp");
pipeline.AddStage(lbApp, new AddStageOpts {
Post = new [] {
new ShellStep("HitEndpoint", new ShellStepProps {
EnvFromCfnOutputs = new Dictionary<string, CfnOutput> {
// Make the load balancer address available as $URL inside the commands
{ "URL", lbApp.LoadBalancerAddress }
},
Commands = new [] { "curl -Ssf $URL" }
}) }
});
Synopsis
Constructors
Stage(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
Stage(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Stage(Construct, String, IStageProps) |
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 |
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(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected Stage(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
Stage(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected Stage(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Stage(Construct, String, IStageProps)
public Stage(Construct scope, string id, IStageProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IStageProps
Properties
Account
The default account for all resources defined within this stage.
public virtual string Account { get; }
Property Value
System.String
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
System.String
Remarks
Derived from the construct path.
AssetOutdir
The cloud assembly asset output directory.
public virtual string AssetOutdir { get; }
Property Value
System.String
Outdir
The cloud assembly output directory.
public virtual string Outdir { get; }
Property Value
System.String
ParentStage
The parent stage or undefined
if this is the app.
public virtual Stage ParentStage { get; }
Property Value
Remarks
Region
The default region for all resources defined within this stage.
public virtual string Region { get; }
Property Value
System.String
StageName
The name of the stage.
public virtual string StageName { get; }
Property Value
System.String
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 System.Object
Returns
System.Boolean
Of(IConstruct)
Return the stage this construct is contained with, if available.
public static Stage Of(IConstruct construct)
Parameters
- construct Constructs.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.