Class WebSocketStage

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.core.Construct
software.amazon.awscdk.core.Resource
software.amazon.awscdk.services.apigatewayv2.WebSocketStage
All Implemented Interfaces:
IConstruct, IDependable, IResource, IStage, IWebSocketStage, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:43.359Z") @Stability(Experimental) public class WebSocketStage extends Resource implements IWebSocketStage, IStage
(experimental) Represents a stage where an instance of the API is deployed.

Example:

 import software.amazon.awscdk.services.apigatewayv2.integrations.WebSocketLambdaIntegration;
 Function messageHandler;
 WebSocketApi webSocketApi = new WebSocketApi(this, "mywsapi");
 WebSocketStage.Builder.create(this, "mystage")
         .webSocketApi(webSocketApi)
         .stageName("dev")
         .autoDeploy(true)
         .build();
 webSocketApi.addRoute("sendmessage", WebSocketRouteOptions.builder()
         .integration(new WebSocketLambdaIntegration("SendMessageIntegration", messageHandler))
         .build());
 
  • Constructor Details

    • WebSocketStage

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

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

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

    • fromWebSocketStageAttributes

      @Stability(Experimental) @NotNull public static IWebSocketStage fromWebSocketStageAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull WebSocketStageAttributes attrs)
      (experimental) Import an existing stage into this CDK app.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • grantManagementApiAccess

      @Stability(Experimental) @NotNull public Grant grantManagementApiAccess(@NotNull IGrantable identity)
      (experimental) Grant access to the API Gateway management API for this WebSocket API Stage to an IAM principal (Role/Group/User).

      Parameters:
      identity - The principal. This parameter is required.
    • metric

      @Stability(Experimental) @NotNull public Metric metric(@NotNull String metricName, @Nullable MetricOptions props)
      (experimental) Return the given named metric for this HTTP Api Gateway Stage.

      Specified by:
      metric in interface IStage
      Parameters:
      metricName - This parameter is required.
      props -
    • metric

      @Stability(Experimental) @NotNull public Metric metric(@NotNull String metricName)
      (experimental) Return the given named metric for this HTTP Api Gateway Stage.

      Specified by:
      metric in interface IStage
      Parameters:
      metricName - This parameter is required.
    • getApi

      @Stability(Experimental) @NotNull public IWebSocketApi getApi()
      (experimental) The API this stage is associated to.
      Specified by:
      getApi in interface IWebSocketStage
    • getBaseApi

      @Stability(Experimental) @NotNull protected IApi getBaseApi()
    • getCallbackUrl

      @Stability(Experimental) @NotNull public String getCallbackUrl()
      (experimental) The callback URL to this stage.
      Specified by:
      getCallbackUrl in interface IWebSocketStage
    • getStageName

      @Stability(Experimental) @NotNull public String getStageName()
      (experimental) The name of the stage;

      its primary identifier.

      Specified by:
      getStageName in interface IStage
    • getUrl

      @Stability(Experimental) @NotNull public String getUrl()
      (experimental) The websocket URL to this stage.
      Specified by:
      getUrl in interface IStage