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, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class WebSocketStage Inherits Resource Implements IWebSocketStage, IStage, IResource, IConstruct, IDependable, IEnvironmentAware
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
Examples
IWebSocketApi webSocketApi;
var importedStage = WebSocketStage.FromWebSocketStageAttributes(this, "imported-stage", new WebSocketStageAttributes {
StageName = "myStage",
Api = webSocketApi
});
var apiKey = new ApiKey(this, "MyApiKey");
var usagePlan = new UsagePlan(this, "MyUsagePlan", new UsagePlanProps {
ApiStages = new [] { new UsagePlanPerApiStage { Api = webSocketApi, Stage = importedStage } }
});
usagePlan.AddApiKey(apiKey);
Synopsis
Constructors
| WebSocketStage(Construct, string, IWebSocketStageProps) | Represents a stage where an instance of the API is deployed. |
Properties
| Api | The API this stage is associated to. |
| BaseApi | Represents a stage where an instance of the API is deployed. |
| CallbackUrl | The callback URL to this stage. |
| PROPERTY_INJECTION_ID | Uniquely identifies this class. |
| StageName | The name of the stage; |
| Url | The websocket URL to this stage. |
Methods
| AddStageVariable(string, string) | Adds a stage variable to this stage. |
| DefaultAccessLogFormat() | CLF Log format for WebSocket API Stage. |
| 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(Construct, string, IWebSocketStageProps)
Represents a stage where an instance of the API is deployed.
public WebSocketStage(Construct scope, string id, IWebSocketStageProps props)
Parameters
- scope Construct
- id string
- props IWebSocketStageProps
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
Examples
IWebSocketApi webSocketApi;
var importedStage = WebSocketStage.FromWebSocketStageAttributes(this, "imported-stage", new WebSocketStageAttributes {
StageName = "myStage",
Api = webSocketApi
});
var apiKey = new ApiKey(this, "MyApiKey");
var usagePlan = new UsagePlan(this, "MyUsagePlan", new UsagePlanProps {
ApiStages = new [] { new UsagePlanPerApiStage { Api = webSocketApi, Stage = importedStage } }
});
usagePlan.AddApiKey(apiKey);
Properties
Api
The API this stage is associated to.
public virtual IWebSocketApi Api { get; }
Property Value
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
BaseApi
Represents a stage where an instance of the API is deployed.
protected virtual IApi BaseApi { get; }
Property Value
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
Examples
IWebSocketApi webSocketApi;
var importedStage = WebSocketStage.FromWebSocketStageAttributes(this, "imported-stage", new WebSocketStageAttributes {
StageName = "myStage",
Api = webSocketApi
});
var apiKey = new ApiKey(this, "MyApiKey");
var usagePlan = new UsagePlan(this, "MyUsagePlan", new UsagePlanProps {
ApiStages = new [] { new UsagePlanPerApiStage { Api = webSocketApi, Stage = importedStage } }
});
usagePlan.AddApiKey(apiKey);
CallbackUrl
The callback URL to this stage.
public virtual string CallbackUrl { get; }
Property Value
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
PROPERTY_INJECTION_ID
Uniquely identifies this class.
public static string PROPERTY_INJECTION_ID { get; }
Property Value
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
StageName
The name of the stage;
public virtual string StageName { get; }
Property Value
Remarks
its primary identifier.
Url
The websocket URL to this stage.
public virtual string Url { get; }
Property Value
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
Methods
AddStageVariable(string, string)
Adds a stage variable to this stage.
public virtual void AddStageVariable(string name, string value)
Parameters
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
DefaultAccessLogFormat()
CLF Log format for WebSocket API Stage.
public virtual AccessLogFormat DefaultAccessLogFormat()
Returns
Remarks
FromWebSocketStageAttributes(Construct, string, IWebSocketStageAttributes)
Import an existing stage into this CDK app.
public static IWebSocketStage FromWebSocketStageAttributes(Construct scope, string id, IWebSocketStageAttributes attrs)
Parameters
- scope Construct
- id string
- attrs IWebSocketStageAttributes
Returns
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
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
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused
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 string
- props IMetricOptions
Returns
Remarks
Resource: AWS::ApiGatewayV2::Stage
ExampleMetadata: infused