Show / Hide Table of Contents

Class WebSocketStage

Represents a stage where an instance of the API is deployed.

Inheritance
object
Resource
WebSocketStage
Implements
IWebSocketStage
IStage
IResource
IConstruct
IDependable
IEnvironmentAware
Inherited Members
Resource.IsOwnedResource(IConstruct)
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(string, IArnComponents)
Resource.GetResourceNameAttribute(string)
Resource.Env
Resource.PhysicalName
Resource.Stack
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

IWebSocketApi

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

IApi

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

string

Remarks

Resource: AWS::ApiGatewayV2::Stage

ExampleMetadata: infused

PROPERTY_INJECTION_ID

Uniquely identifies this class.

public static string PROPERTY_INJECTION_ID { get; }
Property Value

string

Remarks

Resource: AWS::ApiGatewayV2::Stage

ExampleMetadata: infused

StageName

The name of the stage;

public virtual string StageName { get; }
Property Value

string

Remarks

its primary identifier.

Url

The websocket URL to this stage.

public virtual string Url { get; }
Property Value

string

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
name string
value string
Remarks

Resource: AWS::ApiGatewayV2::Stage

ExampleMetadata: infused

DefaultAccessLogFormat()

CLF Log format for WebSocket API Stage.

public virtual AccessLogFormat DefaultAccessLogFormat()
Returns

AccessLogFormat

Remarks

See: https://docs.aws.amazon.com/apigateway/latest/developerguide/websocket-api-logging.html

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

IWebSocketStage

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

Grant

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

Metric

Remarks

Resource: AWS::ApiGatewayV2::Stage

ExampleMetadata: infused

Implements

IWebSocketStage
IStage
IResource
Constructs.IConstruct
Constructs.IDependable
IEnvironmentAware
Back to top Generated by DocFX