WebSocketLambdaIntegration
- class aws_cdk.aws_apigatewayv2_integrations.WebSocketLambdaIntegration(id, handler)
Bases:
WebSocketRouteIntegration
(experimental) Lambda WebSocket Integration.
- Stability:
experimental
- ExampleMetadata:
infused
Example:
from aws_cdk.aws_apigatewayv2_integrations import WebSocketLambdaIntegration # message_handler: lambda.Function web_socket_api = apigwv2.WebSocketApi(self, "mywsapi") apigwv2.WebSocketStage(self, "mystage", web_socket_api=web_socket_api, stage_name="dev", auto_deploy=True ) web_socket_api.add_route("sendmessage", integration=WebSocketLambdaIntegration("SendMessageIntegration", message_handler) )
- Parameters:
id (
str
) – id of the underlying integration construct.handler (
IFunction
) – the Lambda function handler.
- Stability:
experimental
Methods
- bind(*, route, scope)
(experimental) Bind this integration to the route.
- Parameters:
route (
IWebSocketRoute
) – (experimental) The route to which this is being bound.scope (
Construct
) – (experimental) The current scope in which the bind is occurring. If theWebSocketRouteIntegration
being bound creates additional constructs, this will be used as their parent scope.
- Stability:
experimental
- Return type: