Interface IWebSocketApiProps
Props for WebSocket API.
Namespace: Amazon.CDK.AWS.Apigatewayv2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IWebSocketApiProps
Syntax (vb)
Public Interface 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
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. |
Properties
ApiKeySelectionExpression
An API key selection expression.
virtual WebSocketApiKeySelectionExpression ApiKeySelectionExpression { get; }
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.
virtual string ApiName { get; }
Property Value
System.String
Remarks
Default: - id of the WebSocketApi construct.
ConnectRouteOptions
Options to configure a '$connect' route.
virtual IWebSocketRouteOptions ConnectRouteOptions { get; }
Property Value
Remarks
Default: - no '$connect' route configured
DefaultRouteOptions
Options to configure a '$default' route.
virtual IWebSocketRouteOptions DefaultRouteOptions { get; }
Property Value
Remarks
Default: - no '$default' route configured
Description
The description of the API.
virtual string Description { get; }
Property Value
System.String
Remarks
Default: - none
DisconnectRouteOptions
Options to configure a '$disconnect' route.
virtual IWebSocketRouteOptions DisconnectRouteOptions { get; }
Property Value
Remarks
Default: - no '$disconnect' route configured
RouteSelectionExpression
The route selection expression for the API.
virtual string RouteSelectionExpression { get; }
Property Value
System.String
Remarks
Default: '$request.body.action'