Skip to content
v2.275.0

WebSocketStageProps Struct ​

Properties to initialize an instance of WebSocketStage.

Example ​

ts
import * as logs from 'aws-cdk-lib/aws-logs';

declare const httpApi: apigwv2.HttpApi;
declare const webSocketApi : apigwv2.WebSocketApi;
declare const logGroup: logs.LogGroup;

new apigwv2.HttpStage(this, 'HttpStage', {
  httpApi,
  accessLogSettings: {
    destination: new apigwv2.LogGroupLogDestination(logGroup),
  },
});

new apigwv2.WebSocketStage(this, 'WebSocketStage', {
  webSocketApi,
  stageName: 'dev',
  accessLogSettings: {
    destination: new apigwv2.LogGroupLogDestination(logGroup),
  },
});

Properties ​

accessLogSettingsoptionalIAccessLogSettingsaccess_log_settingsoptionalIAccessLogSettingsaccessLogSettingsoptionalIAccessLogSettingsAccessLogSettingsoptionalIAccessLogSettingsAccessLogSettingsoptionalIAccessLogSettings#
Settings for access logging.

Default: No access logging

autoDeployoptionalbooleanauto_deployoptionalboolautoDeployoptionalBooleanAutoDeployoptionalboolAutoDeployoptional*bool= false#
Whether updates to an API automatically trigger a new deployment.
descriptionoptionalstringdescriptionoptionalstrdescriptionoptionalStringDescriptionoptionalstringDescriptionoptional*string#
The description for the API stage.

Default: no description

detailedMetricsEnabledoptionalbooleandetailed_metrics_enabledoptionalbooldetailedMetricsEnabledoptionalBooleanDetailedMetricsEnabledoptionalboolDetailedMetricsEnabledoptional*bool= false#
Specifies whether detailed metrics are enabled.
domainMappingoptionalDomainMappingOptionsdomain_mappingoptionalDomainMappingOptionsdomainMappingoptionalDomainMappingOptionsDomainMappingoptionalDomainMappingOptionsDomainMappingoptionalDomainMappingOptions#
The options for custom domain and api mapping.

Default: no custom domain and api mapping configuration

stageNamestringstage_namestrstageNameStringStageNamestringStageName*stringrequired#
The name of the stage.
stageVariablesoptional{ [key: string]: string }stage_variablesoptionaltyping.Mapping[str, str]stageVariablesoptionalMap<String, String>StageVariablesoptionalIDictionary<string, string>StageVariablesoptional*map[string]*string#
Stage variables for the stage. These are key-value pairs that you can define and use in your API routes.

Default: No stage variables

notes

The allowed characters for variable names and the required pattern for variable values are specified here: https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/aws-resource-apigateway-stage.html#cfn-apigateway-stage-variables

throttleoptionalThrottleSettingsthrottleoptionalThrottleSettingsthrottleoptionalThrottleSettingsThrottleoptionalThrottleSettingsThrottleoptionalThrottleSettings#
Throttle settings for the routes of this stage.

Default: no throttling configuration

webSocketApiIWebSocketApiweb_socket_apiIWebSocketApiwebSocketApiIWebSocketApiWebSocketApiIWebSocketApiWebSocketApiIWebSocketApirequired#
The WebSocket API to which this stage is associated.