# WebSocketStageAttributes

The attributes used to import existing WebSocketStage.

Extends: WebSocketStageAttributes
Extends: StageAttributes

- Source: [`aws-apigatewayv2/lib/websocket/stage.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-apigatewayv2/lib/websocket/stage.ts#L51)
- Type last changed: v2.112.0 · 1 Dec 2023

## Example

```ts
declare const webSocketApi: apigwv2.IWebSocketApi;

const importedStage = apigwv2.WebSocketStage.fromWebSocketStageAttributes(this, 'imported-stage', {
  stageName: 'myStage',
  api: webSocketApi,
});

const apiKey = new apigwv2.ApiKey(this, 'MyApiKey');

const usagePlan = new apigwv2.UsagePlan(this, 'MyUsagePlan', {
  apiStages: [{ api: webSocketApi, stage: importedStage }],
});

usagePlan.addApiKey(apiKey);
```

## Properties

- `api`: [IWebSocketApi](/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.IWebSocketApi.html) (required) — The API to which this stage is associated.

- `stageName`: string (required) — The name of the stage.
