Create a new API Gateway WebSocket API endpoint.
import { WebSocketApi } from 'aws-cdk-lib/aws-apigatewayv2';Or use the module namespace:
import * as apigatewayv2 from 'aws-cdk-lib/aws-apigatewayv2';
// apigatewayv2.WebSocketApiConfiguration passed to the constructor as WebSocketApiProps.
apiKeySelectionExpressionOptionalWebSocketApiKeySelectionExpressionAn API key selection expression. Providing this option will require an API Key be provided to access the API.
Default: - Key is not required to access these APIs
apiNameOptionalstringName for the WebSocket API resource.
Default: - id of the WebSocketApi construct.
connectRouteOptionsOptionalWebSocketRouteOptionsOptions to configure a '$connect' route.
Default: - no '$connect' route configured
defaultRouteOptionsOptionalWebSocketRouteOptionsOptions to configure a '$default' route.
Default: - no '$default' route configured
descriptionOptionalstringThe description of the API.
Default: - none
disableSchemaValidationOptionalbooleanAvoid validating models when creating a deployment.
Default: false
disconnectRouteOptionsOptionalWebSocketRouteOptionsOptions to configure a '$disconnect' route.
Default: - no '$disconnect' route configured
ipAddressTypeOptionalIpAddressTypeThe IP address types that can invoke the API.
Default: undefined - AWS default is IPV4
routeSelectionExpressionOptionalstringThe route selection expression for the API.
Default: '$request.body.action'
Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.
Subscribe to Newsletteraws-apigatewayv2