WebSocketRouteProps

class aws_cdk.aws_apigatewayv2.WebSocketRouteProps(*, integration, authorizer=None, return_response=None, route_key, web_socket_api, api_key_required=None)

Bases: WebSocketRouteOptions

Properties to initialize a new Route.

Parameters:
  • integration (WebSocketRouteIntegration) – The integration to be configured on this route.

  • authorizer (Optional[IWebSocketRouteAuthorizer]) – The authorize to this route. You can only set authorizer to a $connect route. Default: - No Authorizer

  • return_response (Optional[bool]) – Should the route send a response to the client. Default: false

  • route_key (str) – The key to this route.

  • web_socket_api (IWebSocketApi) – The API the route is associated with.

  • api_key_required (Optional[bool]) – Whether the route requires an API Key to be provided. Default: false

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_apigatewayv2 as apigatewayv2

# web_socket_api: apigatewayv2.WebSocketApi
# web_socket_route_authorizer: apigatewayv2.IWebSocketRouteAuthorizer
# web_socket_route_integration: apigatewayv2.WebSocketRouteIntegration

web_socket_route_props = apigatewayv2.WebSocketRouteProps(
    integration=web_socket_route_integration,
    route_key="routeKey",
    web_socket_api=web_socket_api,

    # the properties below are optional
    api_key_required=False,
    authorizer=web_socket_route_authorizer,
    return_response=False
)

Attributes

api_key_required

Whether the route requires an API Key to be provided.

Default:

false

authorizer

The authorize to this route.

You can only set authorizer to a $connect route.

Default:
  • No Authorizer

integration

The integration to be configured on this route.

return_response

Should the route send a response to the client.

Default:

false

route_key

The key to this route.

web_socket_api

The API the route is associated with.