Class WebSocketApiProps
Props for WebSocket API.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.Apigatewayv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class WebSocketApiProps : Object, IWebSocketApiProps
Syntax (vb)
Public Class WebSocketApiProps
Inherits Object
Implements IWebSocketApiProps
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AwsApigatewayv2Authorizers;
using Amazon.CDK.AwsApigatewayv2Integrations;
// This function handles your auth logic
Function authHandler;
// This function handles your WebSocket requests
Function handler;
var authorizer = new WebSocketLambdaAuthorizer("Authorizer", authHandler);
var integration = new WebSocketLambdaIntegration("Integration", handler);
new WebSocketApi(this, "WebSocketApi", new WebSocketApiProps {
ConnectRouteOptions = new WebSocketRouteOptions {
Integration = integration,
Authorizer = authorizer
}
});
Synopsis
Constructors
WebSocketApiProps() |
Properties
ApiKeySelectionExpression | An API key selection expression. |
ApiName | Name for the WebSocket API resource. |
ConnectRouteOptions | Options to configure a '$connect' route. |
DefaultRouteOptions | Options to configure a '$default' route. |
Description | The description of the API. |
DisconnectRouteOptions | Options to configure a '$disconnect' route. |
RouteSelectionExpression | The route selection expression for the API. |
Constructors
WebSocketApiProps()
public WebSocketApiProps()
Properties
ApiKeySelectionExpression
An API key selection expression.
public WebSocketApiKeySelectionExpression ApiKeySelectionExpression { get; set; }
Property Value
WebSocketApiKeySelectionExpression
Remarks
Providing this option will require an API Key be provided to access the API.
Default: - Key is not required to access these APIs
ApiName
Name for the WebSocket API resource.
public string ApiName { get; set; }
Property Value
System.String
Remarks
Default: - id of the WebSocketApi construct.
ConnectRouteOptions
Options to configure a '$connect' route.
public IWebSocketRouteOptions ConnectRouteOptions { get; set; }
Property Value
Remarks
Default: - no '$connect' route configured
DefaultRouteOptions
Options to configure a '$default' route.
public IWebSocketRouteOptions DefaultRouteOptions { get; set; }
Property Value
Remarks
Default: - no '$default' route configured
Description
The description of the API.
public string Description { get; set; }
Property Value
System.String
Remarks
Default: - none
DisconnectRouteOptions
Options to configure a '$disconnect' route.
public IWebSocketRouteOptions DisconnectRouteOptions { get; set; }
Property Value
Remarks
Default: - no '$disconnect' route configured
RouteSelectionExpression
The route selection expression for the API.
public string RouteSelectionExpression { get; set; }
Property Value
System.String
Remarks
Default: '$request.body.action'