Skip to content
v2.274.0

WebSocketRouteIntegration Class ​

The interface that various route integration classes will inherit.

Example ​

ts
import { WebSocketLambdaIntegration } from 'aws-cdk-lib/aws-apigatewayv2-integrations';

const webSocketApi = new apigwv2.WebSocketApi(this, 'mywsapi');
new apigwv2.WebSocketStage(this, 'mystage', {
  webSocketApi,
  stageName: 'dev',
  autoDeploy: true,
});

declare const messageHandler: lambda.Function;
webSocketApi.addRoute('sendMessage', {
  integration: new WebSocketLambdaIntegration('SendMessageIntegration', messageHandler),
});

Initializer ​

ts
new WebSocketRouteIntegration(id: string)
python
WebSocketRouteIntegration(id: str)
java
new WebSocketRouteIntegration(String id)
csharp
new WebSocketRouteIntegration(string id)
go
NewWebSocketRouteIntegration(Id *string)

Methods ​

bind(options: WebSocketRouteIntegrationBindOptions): WebSocketRouteIntegrationConfigdef bind(self, options: WebSocketRouteIntegrationBindOptions) -> WebSocketRouteIntegrationConfigpublic WebSocketRouteIntegrationConfig bind(WebSocketRouteIntegrationBindOptions options)public WebSocketRouteIntegrationConfig Bind(WebSocketRouteIntegrationBindOptions options)func Bind(Options WebSocketRouteIntegrationBindOptions) WebSocketRouteIntegrationConfig#
Bind this integration to the route.