WebSocketStageProps

class aws_cdk.aws_apigatewayv2.WebSocketStageProps(*, auto_deploy=None, domain_mapping=None, stage_name, web_socket_api)

Bases: aws_cdk.aws_apigatewayv2.StageOptions

(experimental) Properties to initialize an instance of WebSocketStage.

Parameters
  • auto_deploy (Optional[bool]) – (experimental) Whether updates to an API automatically trigger a new deployment. Default: false

  • domain_mapping (Optional[DomainMappingOptions]) – (experimental) The options for custom domain and api mapping. Default: - no custom domain and api mapping configuration

  • stage_name (str) – (experimental) The name of the stage.

  • web_socket_api (IWebSocketApi) – (experimental) The WebSocket API to which this stage is associated.

Stability

experimental

Example:

from aws_cdk.aws_apigatewayv2_integrations import LambdaWebSocketIntegration

# connect_handler is of type Function
# disconnect_handler is of type Function
# default_handler is of type Function


web_socket_api = apigwv2.WebSocketApi(self, "mywsapi",
    connect_route_options=apigwv2.WebSocketRouteOptions(integration=LambdaWebSocketIntegration(handler=connect_handler)),
    disconnect_route_options=apigwv2.WebSocketRouteOptions(integration=LambdaWebSocketIntegration(handler=disconnect_handler)),
    default_route_options=apigwv2.WebSocketRouteOptions(integration=LambdaWebSocketIntegration(handler=default_handler))
)

apigwv2.WebSocketStage(self, "mystage",
    web_socket_api=web_socket_api,
    stage_name="dev",
    auto_deploy=True
)

Attributes

auto_deploy

(experimental) Whether updates to an API automatically trigger a new deployment.

Default

false

Stability

experimental

Return type

Optional[bool]

domain_mapping

(experimental) The options for custom domain and api mapping.

Default
  • no custom domain and api mapping configuration

Stability

experimental

Return type

Optional[DomainMappingOptions]

stage_name

(experimental) The name of the stage.

Stability

experimental

Return type

str

web_socket_api

(experimental) The WebSocket API to which this stage is associated.

Stability

experimental

Return type

IWebSocketApi