@aws-cdk_aws-apigatewayv2-alpha.WebSocketApiProps

interface WebSocketApiProps ๐Ÿ”น

LanguageType name
.NETAmazon.CDK.AWS.Apigatewayv2.Alpha.WebSocketApiProps
Gogithub.com/aws/aws-cdk-go/awscdkapigatewayv2alpha/v2#WebSocketApiProps
Javasoftware.amazon.awscdk.services.apigatewayv2.alpha.WebSocketApiProps
Pythonaws_cdk.aws_apigatewayv2_alpha.WebSocketApiProps
TypeScript (source)@aws-cdk/aws-apigatewayv2-alpha ยป WebSocketApiProps

Props for WebSocket API.

Example

import { WebSocketLambdaAuthorizer } from '@aws-cdk/aws-apigatewayv2-authorizers-alpha';
import { WebSocketLambdaIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

// This function handles your auth logic
declare const authHandler: lambda.Function;

// This function handles your WebSocket requests
declare const handler: lambda.Function;

const authorizer = new WebSocketLambdaAuthorizer('Authorizer', authHandler);

const integration = new WebSocketLambdaIntegration(
  'Integration',
  handler,
);

new apigwv2.WebSocketApi(this, 'WebSocketApi', {
  connectRouteOptions: {
    integration,
    authorizer,
  },
});

Properties

NameTypeDescription
apiKeySelectionExpression?๐Ÿ”นWebSocketApiKeySelectionExpressionAn API key selection expression.
apiName?๐Ÿ”นstringName for the WebSocket API resource.
connectRouteOptions?๐Ÿ”นWebSocketRouteOptionsOptions to configure a '$connect' route.
defaultRouteOptions?๐Ÿ”นWebSocketRouteOptionsOptions to configure a '$default' route.
description?๐Ÿ”นstringThe description of the API.
disconnectRouteOptions?๐Ÿ”นWebSocketRouteOptionsOptions to configure a '$disconnect' route.
routeSelectionExpression?๐Ÿ”นstringThe route selection expression for the API.

apiKeySelectionExpression?๐Ÿ”น

Type: WebSocketApiKeySelectionExpression (optional, default: Key is not required to access these APIs)

An API key selection expression.

Providing this option will require an API Key be provided to access the API.


apiName?๐Ÿ”น

Type: string (optional, default: id of the WebSocketApi construct.)

Name for the WebSocket API resource.


connectRouteOptions?๐Ÿ”น

Type: WebSocketRouteOptions (optional, default: no '$connect' route configured)

Options to configure a '$connect' route.


defaultRouteOptions?๐Ÿ”น

Type: WebSocketRouteOptions (optional, default: no '$default' route configured)

Options to configure a '$default' route.


description?๐Ÿ”น

Type: string (optional, default: none)

The description of the API.


disconnectRouteOptions?๐Ÿ”น

Type: WebSocketRouteOptions (optional, default: no '$disconnect' route configured)

Options to configure a '$disconnect' route.


routeSelectionExpression?๐Ÿ”น

Type: string (optional, default: '$request.body.action')

The route selection expression for the API.