AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

WebSocketRoute

Route class that creates the Route for API Gateway WebSocket API.

Import

import { WebSocketRoute } from 'aws-cdk-lib/aws-apigatewayv2';

Or use the module namespace:

import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.WebSocketRoute

Properties

Configuration passed to the constructor as WebSocketRouteProps.

routeKeyRequired
string

The key to this route.

webSocketApiRequired
IWebSocketApi

The API the route is associated with.

apiKeyRequiredOptional
boolean

Whether the route requires an API Key to be provided.

Default: false

3 properties inherited from WebSocketRouteOptions
integrationRequiredinherited from WebSocketRouteOptions
WebSocketRouteIntegration

The integration to be configured on this route.

authorizerOptionalinherited from WebSocketRouteOptions
IWebSocketRouteAuthorizer

The authorize to this route. You can only set authorizer to a $connect route.

Default: - No Authorizer

returnResponseOptionalinherited from WebSocketRouteOptions
boolean

Should the route send a response to the client.

Default: false

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter