ExitAmazon API Gateway: WebSocket connection routing1 / 9
Explanation

Separate the connection gate from message handling

How WebSocket connection lifecycles, connection-time authorization, route integrations, and connection callbacks support bidirectional messaging. · advanced

A WebSocket API separates a long-lived connection from the route invocations that process its messages. This diagram uses Lambda integrations and an application-owned connection registry; its arrows show logical operations, not every response.

A Lambda REQUEST authorizer can run only on $connect. It is separate from the route integration that performs application work. Connection-time authorization is therefore not a fresh authorizer decision for each later message.

Keep the component roles precise: IAM supplies permissions, not executable Lambda authorizer logic. Elastic Load Balancing can support WebSocket traffic, but does not implement API Gateway's named WebSocket routes and Lambda REQUEST authorizer mechanism.

Connect and messages$connect authorizationRoute invocationRegistry operationsPostToConnectionPushed message
UsersWebSocket client
Amazon API GatewayWebSocket API and connection management API
AWS Lambda$connect REQUEST authorizer
AWS LambdaRoute integration handlers
Amazon DynamoDB tableApplication connection registry

1 / 7 The client starts a WebSocket connection through API Gateway. The $connect route runs while connection establishment is pending.

AWS architecture icons are the property of Amazon Web Services. BlowStack is not affiliated with or endorsed by AWS.