Class WebSocketApi
(experimental) Create a new API Gateway WebSocket API endpoint.
Inherited Members
Namespace: Amazon.CDK.AWS.APIGatewayv2
Assembly: Amazon.CDK.AWS.APIGatewayv2.dll
Syntax (csharp)
public class WebSocketApi : Resource, IWebSocketApi, IApi, IResource, IConstruct, IDependable
Syntax (vb)
Public Class WebSocketApi
Inherits Resource
Implements IWebSocketApi, IApi, IResource, IConstruct, IDependable
Remarks
Stability: Experimental
Resource: AWS::ApiGatewayV2::Api
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.APIGatewayv2.Integrations;
Function messageHandler;
var webSocketApi = new WebSocketApi(this, "mywsapi");
webSocketApi.AddRoute("sendmessage", new WebSocketRouteOptions {
Integration = new WebSocketLambdaIntegration("SendMessageIntegration", messageHandler)
});
Synopsis
Constructors
WebSocketApi(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
WebSocketApi(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
WebSocketApi(Construct, String, IWebSocketApiProps) |
Properties
ApiEndpoint | (experimental) The default endpoint for an API. |
ApiId | (experimental) The identifier of this API Gateway API. |
WebSocketApiName | (experimental) A human friendly name for this WebSocket API. |
Methods
AddRoute(String, IWebSocketRouteOptions) | (experimental) Add a new route. |
FromWebSocketApiAttributes(Construct, String, IWebSocketApiAttributes) | (experimental) Import an existing WebSocket API into this CDK app. |
GrantManageConnections(IGrantable) | (experimental) Grant access to the API Gateway management API for this WebSocket API to an IAM principal (Role/Group/User). |
Metric(String, IMetricOptions) | (experimental) Return the given named metric for this Api Gateway. |
Constructors
WebSocketApi(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected WebSocketApi(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
WebSocketApi(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected WebSocketApi(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
WebSocketApi(Construct, String, IWebSocketApiProps)
public WebSocketApi(Construct scope, string id, IWebSocketApiProps props = null)
Parameters
- scope Constructs.Construct
- id System.String
- props IWebSocketApiProps
Remarks
Stability: Experimental
Properties
ApiEndpoint
(experimental) The default endpoint for an API.
public virtual string ApiEndpoint { get; }
Property Value
System.String
Remarks
Stability: Experimental
ApiId
(experimental) The identifier of this API Gateway API.
public virtual string ApiId { get; }
Property Value
System.String
Remarks
Stability: Experimental
WebSocketApiName
(experimental) A human friendly name for this WebSocket API.
public virtual string WebSocketApiName { get; }
Property Value
System.String
Remarks
Note that this is different from webSocketApiId
.
Stability: Experimental
Methods
AddRoute(String, IWebSocketRouteOptions)
(experimental) Add a new route.
public virtual WebSocketRoute AddRoute(string routeKey, IWebSocketRouteOptions options)
Parameters
- routeKey System.String
- options IWebSocketRouteOptions
Returns
Remarks
Stability: Experimental
FromWebSocketApiAttributes(Construct, String, IWebSocketApiAttributes)
(experimental) Import an existing WebSocket API into this CDK app.
public static IWebSocketApi FromWebSocketApiAttributes(Construct scope, string id, IWebSocketApiAttributes attrs)
Parameters
- scope Constructs.Construct
- id System.String
- attrs IWebSocketApiAttributes
Returns
Remarks
Stability: Experimental
GrantManageConnections(IGrantable)
(experimental) Grant access to the API Gateway management API for this WebSocket API to an IAM principal (Role/Group/User).
public virtual Grant GrantManageConnections(IGrantable identity)
Parameters
- identity IGrantable
The principal.
Returns
Remarks
Stability: Experimental
Metric(String, IMetricOptions)
(experimental) Return the given named metric for this Api Gateway.
public virtual Metric Metric(string metricName, IMetricOptions props = null)
Parameters
- metricName System.String
- props IMetricOptions
Returns
Remarks
Stability: Experimental