@aws-cdk_aws-apigatewayv2-integrations-alpha.WebSocketLambdaIntegration
class WebSocketLambdaIntegration
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Apigatewayv2.Integrations.Alpha.WebSocketLambdaIntegration |
![]() | github.com/aws/aws-cdk-go/awscdkapigatewayv2integrationsalpha/v2#WebSocketLambdaIntegration |
![]() | software.amazon.awscdk.services.apigatewayv2.integrations.alpha.WebSocketLambdaIntegration |
![]() | aws_cdk.aws_apigatewayv2_integrations_alpha.WebSocketLambdaIntegration |
![]() | @aws-cdk/aws-apigatewayv2-integrations-alpha ยป WebSocketLambdaIntegration |
Extends
Web
Lambda WebSocket Integration.
Example
import { WebSocketLambdaIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';
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.