Skip to content
v2.277.0

WebSocketApiAttributes Struct ​

Attributes for importing a WebSocketApi into the CDK.

Example ​

ts
const webSocketApi = apigwv2.WebSocketApi.fromWebSocketApiAttributes(this, 'mywsapi', { webSocketId: 'api-1234' });
python
web_socket_api = apigwv2.WebSocketApi.from_web_socket_api_attributes(self, "mywsapi", web_socket_id="api-1234")
java
IWebSocketApi webSocketApi = WebSocketApi.fromWebSocketApiAttributes(this, "mywsapi", WebSocketApiAttributes.builder().webSocketId("api-1234").build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
var webSocketApi = WebSocketApi.FromWebSocketApiAttributes(this, "mywsapi", new WebSocketApiAttributes { WebSocketId = "api-1234" });
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 ​

apiEndpointoptionalstringapi_endpointoptionalstrapiEndpointoptionalStringApiEndpointoptionalstringApiEndpointoptional*string #
The endpoint URL of the WebSocketApi.

Default: throw san error if apiEndpoint is accessed.

webSocketIdstringweb_socket_idstrwebSocketIdStringWebSocketIdstringWebSocketId*string required #
The identifier of the WebSocketApi.