WebSocketRouteOptions

class aws_cdk.aws_apigatewayv2.WebSocketRouteOptions(*, integration)

Bases: object

(experimental) Options used to add route to the API.

Parameters

integration (IWebSocketRouteIntegration) – (experimental) The integration to be configured on this route.

Stability

experimental

Example:

from aws_cdk.aws_apigatewayv2_integrations import LambdaWebSocketIntegration

# message_handler is of type 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=LambdaWebSocketIntegration(
        handler=message_handler
    )
)

Attributes

integration

(experimental) The integration to be configured on this route.

Stability

experimental

Return type

IWebSocketRouteIntegration