Class WebSocketStage
Represents a stage where an instance of the API is deployed.
Inherited Members
Namespace: Amazon.CDK.AWS.Apigatewayv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class WebSocketStage : Resource, IWebSocketStage, IStage, IResource
Syntax (vb)
Public Class WebSocketStage
Inherits Resource
Implements IWebSocketStage, IStage, IResource
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
Examples
using Amazon.CDK.WebSocketLambdaIntegration;
Function connectHandler;
Function disconnectHandler;
Function defaultHandler;
var webSocketApi = new WebSocketApi(this, "mywsapi", new WebSocketApiProps {
ConnectRouteOptions = new WebSocketRouteOptions { Integration = new WebSocketLambdaIntegration("ConnectIntegration", connectHandler) },
DisconnectRouteOptions = new WebSocketRouteOptions { Integration = new WebSocketLambdaIntegration("DisconnectIntegration", disconnectHandler) },
DefaultRouteOptions = new WebSocketRouteOptions { Integration = new WebSocketLambdaIntegration("DefaultIntegration", defaultHandler) }
});
new WebSocketStage(this, "mystage", new WebSocketStageProps {
WebSocketApi = webSocketApi,
StageName = "dev",
AutoDeploy = true
});
Synopsis
Constructors
WebSocketStage(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
WebSocketStage(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
WebSocketStage(Construct, String, IWebSocketStageProps) |
Properties
Api | The API this stage is associated to. |
BaseApi | |
CallbackUrl | The callback URL to this stage. |
StageName | The name of the stage; |
Url | The websocket URL to this stage. |
Methods
FromWebSocketStageAttributes(Construct, String, IWebSocketStageAttributes) | Import an existing stage into this CDK app. |
GrantManagementApiAccess(IGrantable) | Grant access to the API Gateway management API for this WebSocket API Stage to an IAM principal (Role/Group/User). |
Metric(String, IMetricOptions) | Return the given named metric for this HTTP Api Gateway Stage. |
Constructors
WebSocketStage(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected WebSocketStage(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
WebSocketStage(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected WebSocketStage(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
WebSocketStage(Construct, String, IWebSocketStageProps)
public WebSocketStage(Construct scope, string id, IWebSocketStageProps props)
Parameters
- scope Constructs.Construct
- id System.String
- props IWebSocketStageProps
Properties
Api
The API this stage is associated to.
public virtual IWebSocketApi Api { get; }
Property Value
BaseApi
CallbackUrl
The callback URL to this stage.
public virtual string CallbackUrl { get; }
Property Value
System.String
StageName
The name of the stage;
public virtual string StageName { get; }
Property Value
System.String
Remarks
its primary identifier.
Url
The websocket URL to this stage.
public virtual string Url { get; }
Property Value
System.String
Methods
FromWebSocketStageAttributes(Construct, String, IWebSocketStageAttributes)
Import an existing stage into this CDK app.
public static IWebSocketStage FromWebSocketStageAttributes(Construct scope, string id, IWebSocketStageAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IWebSocketStageAttributes
Returns
GrantManagementApiAccess(IGrantable)
Grant access to the API Gateway management API for this WebSocket API Stage to an IAM principal (Role/Group/User).
public virtual Grant GrantManagementApiAccess(IGrantable identity)
Parameters
- identity IGrantable
The principal.
Returns
Metric(String, IMetricOptions)
Return the given named metric for this HTTP Api Gateway Stage.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns