AWS SAM now supports WebSocket APIs for Amazon API Gateway

AWS Serverless Application Model (AWS SAM) Updates
AWS SAM now supports WebSocket APIs for Amazon API Gateway, allowing you to define complete WebSocket APIs with minimal configuration in your SAM template. This update simplifies the process of building real-time applications such as chat, live dashboards, AI/LLM streaming, and IoT by automatically generating the required resources and permissions from your template.
New Features
- WebSocket API Support: Define WebSocket APIs directly in your SAM template.
- Automatic Resource Generation: SAM automatically generates required resources and permissions.
- Globals Support: Share common configurations across multiple WebSocket APIs.
What to do
- Add the
AWS::Serverless::WebSocketApiresource type to your SAM template. - Define routes by specifying Lambda function handlers for $connect, $disconnect, and $default routes.
- Configure authorization, stage settings, and custom domains within the resource definition.
Source: AWS release notes
If you need further guidance on AWS, our experts are available at AWS@westloop.io. You may also reach us by submitting the Contact Us form.



