# WebSocketApiAttributes

Attributes for importing a WebSocketApi into the CDK.

Used as argument in: [WebSocketApi.fromWebSocketApiAttributes](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigatewayv2.WebSocketApi.html#fromwebsocketapiattributes)

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

## Example

TypeScript:

```ts
const webSocketApi = apigwv2.WebSocketApi.fromWebSocketApiAttributes(this, 'mywsapi', { webSocketId: 'api-1234' });
```

Python:

```python
web_socket_api = apigwv2.WebSocketApi.from_web_socket_api_attributes(self, "mywsapi", web_socket_id="api-1234")
```

Java:

```java
IWebSocketApi webSocketApi = WebSocketApi.fromWebSocketApiAttributes(this, "mywsapi", WebSocketApiAttributes.builder().webSocketId("api-1234").build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var webSocketApi = WebSocketApi.FromWebSocketApiAttributes(this, "mywsapi", new WebSocketApiAttributes { WebSocketId = "api-1234" });
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
webSocketApi := apigwv2.WebSocketApi_FromWebSocketApiAttributes(this, jsii.String("mywsapi"), &WebSocketApiAttributes{
	WebSocketId: jsii.String("api-1234"),
})
```

## Properties

- `apiEndpoint`: string — The endpoint URL of the WebSocketApi.

  **Default:** throw san error if apiEndpoint is accessed.

- `webSocketId`: string (required) — The identifier of the WebSocketApi.
