class WebSocketLambdaIntegration
Language | Type name |
---|---|
.NET | Amazon.CDK.AwsApigatewayv2Integrations.WebSocketLambdaIntegration |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsapigatewayv2integrations#WebSocketLambdaIntegration |
Java | software.amazon.awscdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration |
Python | aws_cdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration |
TypeScript (source) | aws-cdk-lib » aws_apigatewayv2_integrations » WebSocketLambdaIntegration |
Extends
Web
Lambda WebSocket Integration.
Example
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
new WebSocketLambdaIntegration(id: string, handler: IFunction, props?: WebSocketLambdaIntegrationProps)
Parameters
- id
string
— id of the underlying integration construct. - handler
IFunction
— the Lambda function handler. - props
Web
— properties to configure the integration.Socket Lambda Integration Props
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.