WebSocketStageAttributes

class aws_cdk.aws_apigatewayv2.WebSocketStageAttributes(*, stage_name, api)

Bases: StageAttributes

The attributes used to import existing WebSocketStage.

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

  • api (IWebSocketApi) – The API to which this stage is associated.

ExampleMetadata:

infused

Example:

# web_socket_api: apigwv2.IWebSocketApi


imported_stage = apigwv2.WebSocketStage.from_web_socket_stage_attributes(self, "imported-stage",
    stage_name="myStage",
    api=web_socket_api
)

api_key = apigwv2.ApiKey(self, "MyApiKey")

usage_plan = apigwv2.UsagePlan(self, "MyUsagePlan",
    api_stages=[apigwv2.UsagePlanPerApiStage(api=web_socket_api, stage=imported_stage)]
)

usage_plan.add_api_key(api_key)

Attributes

api

The API to which this stage is associated.

stage_name

The name of the stage.