Class Stage

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Stage
All Implemented Interfaces:
IConstruct, IDependable, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct
Direct Known Subclasses:
App

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:29:55.140Z") @Stability(Stable) public class Stage extends 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 application.

You can then instantiate your subclass multiple times to model multiple copies of your application which should be be deployed to different environments.

Example:

 CodePipeline pipeline;
 public class MyOutputStage extends Stage {
     public final CfnOutput loadBalancerAddress;
     public MyOutputStage(Construct scope, String id) {
         this(scope, id, null);
     }
     public MyOutputStage(Construct scope, String id, StageProps props) {
         super(scope, id, props);
         this.loadBalancerAddress = CfnOutput.Builder.create(this, "Output").value("value").build();
     }
 }
 MyOutputStage lbApp = new MyOutputStage(this, "MyApp");
 pipeline.addStage(lbApp, AddStageOpts.builder()
         .post(List.of(
             ShellStep.Builder.create("HitEndpoint")
                     .envFromCfnOutputs(Map.of(
                             // Make the load balancer address available as $URL inside the commands
                             "URL", lbApp.getLoadBalancerAddress()))
                     .commands(List.of("curl -Ssf $URL"))
                     .build()))
         .build());
 
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    A fluent builder for Stage.

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode

    Nested classes/interfaces inherited from interface software.amazon.awscdk.core.IConstruct

    IConstruct.Jsii$Default, IConstruct.Jsii$Proxy

    Nested classes/interfaces inherited from interface software.constructs.IConstruct

    software.constructs.IConstruct.Jsii$Default, software.constructs.IConstruct.Jsii$Proxy
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Stage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    Stage(software.amazon.jsii.JsiiObjectRef objRef)
     
     
    Stage(software.constructs.Construct scope, String id)
     
     
    Stage(software.constructs.Construct scope, String id, StageProps props)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The default account for all resources defined within this stage.
    Artifact ID of the assembly if it is a nested stage.
    The cloud assembly asset output directory.
    The cloud assembly output directory.
    The parent stage or undefined if this is the app.
    The default region for all resources defined within this stage.
    The name of the stage.
    static Boolean
    Test whether the given construct is a stage.
    static Stage
    of(software.constructs.IConstruct construct)
    Return the stage this construct is contained with, if available.
    Synthesize this stage into a cloud assembly.
    Synthesize this stage into a cloud assembly.

    Methods inherited from class software.amazon.awscdk.core.Construct

    getNode, isConstruct, onPrepare, onSynthesize, onValidate, prepare, synthesize, validate

    Methods inherited from class software.constructs.Construct

    toString

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • Stage

      protected Stage(software.amazon.jsii.JsiiObjectRef objRef)
    • Stage

      protected Stage(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • Stage

      @Stability(Stable) public Stage(@NotNull software.constructs.Construct scope, @NotNull String id, @Nullable StageProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props -
    • Stage

      @Stability(Stable) public Stage(@NotNull software.constructs.Construct scope, @NotNull String id)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
  • Method Details

    • isStage

      @Stability(Stable) @NotNull public static Boolean isStage(@NotNull Object x)
      Test whether the given construct is a stage.

      Parameters:
      x - This parameter is required.
    • of

      @Stability(Stable) @Nullable public static Stage of(@NotNull software.constructs.IConstruct construct)
      Return the stage this construct is contained with, if available.

      If called on a nested stage, returns its parent.

      Parameters:
      construct - This parameter is required.
    • synth

      @Stability(Stable) @NotNull public CloudAssembly synth(@Nullable StageSynthesisOptions options)
      Synthesize this stage into a cloud assembly.

      Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.

      Parameters:
      options -
    • synth

      @Stability(Stable) @NotNull public CloudAssembly synth()
      Synthesize this stage into a cloud assembly.

      Once an assembly has been synthesized, it cannot be modified. Subsequent calls will return the same assembly.

    • getArtifactId

      @Stability(Stable) @NotNull public String getArtifactId()
      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.

    • getAssetOutdir

      @Stability(Stable) @NotNull public String getAssetOutdir()
      The cloud assembly asset output directory.
    • getOutdir

      @Stability(Stable) @NotNull public String getOutdir()
      The cloud assembly output directory.
    • getStageName

      @Stability(Stable) @NotNull public String getStageName()
      The name of the stage.

      Based on names of the parent stages separated by hypens.

    • getAccount

      @Stability(Stable) @Nullable public String getAccount()
      The default account for all resources defined within this stage.
    • getParentStage

      @Stability(Stable) @Nullable public Stage getParentStage()
      The parent stage or undefined if this is the app.

    • getRegion

      @Stability(Stable) @Nullable public String getRegion()
      The default region for all resources defined within this stage.