class WebSocketLambdaIntegration
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.APIGatewayv2.Integrations.WebSocketLambdaIntegration |
![]() | software.amazon.awscdk.services.apigatewayv2.integrations.WebSocketLambdaIntegration |
![]() | aws_cdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration |
![]() | @aws-cdk/aws-apigatewayv2-integrations » WebSocketLambdaIntegration |
Extends
Web
Lambda WebSocket Integration.
Example
import { WebSocketLambdaIntegration } from '@aws-cdk/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
new WebSocketLambdaIntegration(id: string, handler: IFunction)
Parameters
- id
string
— id of the underlying integration construct. - handler
IFunction
— the Lambda function handler.
Methods
Name | Description |
---|---|
bind(options) | Bind this integration to the route. |
bind(options)
public bind(options: WebSocketRouteIntegrationBindOptions): WebSocketRouteIntegrationConfig
Parameters
Returns
Bind this integration to the route.