@Generated(value="jsii-pacmak/1.70.0 (build 03c2f6f)", date="2022-11-01T13:16:41.631Z") @Stability(value=Experimental) public interface WebSocketApiProps extends software.amazon.jsii.JsiiSerializable
Example:
import software.amazon.awscdk.services.apigatewayv2.authorizers.WebSocketLambdaAuthorizer;
import software.amazon.awscdk.services.apigatewayv2.integrations.WebSocketLambdaIntegration;
// This function handles your auth logic
Function authHandler;
// This function handles your WebSocket requests
Function handler;
WebSocketLambdaAuthorizer authorizer = new WebSocketLambdaAuthorizer("Authorizer", authHandler);
WebSocketLambdaIntegration integration = new WebSocketLambdaIntegration("Integration", handler);
WebSocketApi.Builder.create(this, "WebSocketApi")
.connectRouteOptions(WebSocketRouteOptions.builder()
.integration(integration)
.authorizer(authorizer)
.build())
.build();
| Modifier and Type | Interface and Description |
|---|---|
static class |
WebSocketApiProps.Builder
A builder for
WebSocketApiProps |
static class |
WebSocketApiProps.Jsii$Proxy
An implementation for
WebSocketApiProps |
| Modifier and Type | Method and Description |
|---|---|
static WebSocketApiProps.Builder |
builder() |
default WebSocketApiKeySelectionExpression |
getApiKeySelectionExpression()
(experimental) An API key selection expression.
|
default String |
getApiName()
(experimental) Name for the WebSocket API resource.
|
default WebSocketRouteOptions |
getConnectRouteOptions()
(experimental) Options to configure a '$connect' route.
|
default WebSocketRouteOptions |
getDefaultRouteOptions()
(experimental) Options to configure a '$default' route.
|
default String |
getDescription()
(experimental) The description of the API.
|
default WebSocketRouteOptions |
getDisconnectRouteOptions()
(experimental) Options to configure a '$disconnect' route.
|
default String |
getRouteSelectionExpression()
(experimental) The route selection expression for the API.
|
@Stability(value=Experimental) @Nullable default WebSocketApiKeySelectionExpression getApiKeySelectionExpression()
Providing this option will require an API Key be provided to access the API.
Default: - Key is not required to access these APIs
@Stability(value=Experimental) @Nullable default String getApiName()
Default: - id of the WebSocketApi construct.
@Stability(value=Experimental) @Nullable default WebSocketRouteOptions getConnectRouteOptions()
Default: - no '$connect' route configured
@Stability(value=Experimental) @Nullable default WebSocketRouteOptions getDefaultRouteOptions()
Default: - no '$default' route configured
@Stability(value=Experimental) @Nullable default String getDescription()
Default: - none
@Stability(value=Experimental) @Nullable default WebSocketRouteOptions getDisconnectRouteOptions()
Default: - no '$disconnect' route configured
@Stability(value=Experimental) @Nullable default String getRouteSelectionExpression()
Default: '$request.body.action'
@Stability(value=Experimental) static WebSocketApiProps.Builder builder()
WebSocketApiProps.Builder of WebSocketApiPropsCopyright © 2022. All rights reserved.