WebSocketRouteIntegration

class aws_cdk.aws_apigatewayv2.WebSocketRouteIntegration(id)

Bases: object

(experimental) The interface that various route integration classes will inherit.

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)
)

(experimental) Initialize an integration for a route on websocket api.

Parameters:

id (str) – id of the underlying WebSocketIntegration construct.

Stability:

experimental

Methods

abstract 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 the WebSocketRouteIntegration being bound creates additional constructs, this will be used as their parent scope.

Stability:

experimental

Return type:

WebSocketRouteIntegrationConfig