WebSocketStageProps

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

Bases: 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 (Union[DomainMappingOptions, Dict[str, Any], None]) – (experimental) The options for custom domain and api mapping. Default: - no custom domain and api mapping configuration

  • throttle (Union[ThrottleSettings, Dict[str, Any], None]) – (experimental) Throttle settings for the routes of this stage. Default: - no throttling 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

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

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

throttle

(experimental) Throttle settings for the routes of this stage.

Default
  • no throttling configuration

Stability

experimental

Return type

Optional[ThrottleSettings]

web_socket_api

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

Stability

experimental

Return type

IWebSocketApi