Serverless Messaging with AWS SAM: SNS, SQS, and Lambda

This example shows how to build a serverless messaging pipeline using AWS SAM. The project uses SNS to publish messages, SQS queues to separate concerns, and Lambda functions to process the data. It also uses filter policies to control message delivery to each queue. This architecture is useful when you want to send different types of data to different consumers, and keep your application components decoupled. Project Structure The template defines: ...

Serverless API Monitoring with AWS SAM: Lambda, API Gateway & CloudWatch Alarms

This example demonstrates how to build a lightweight, serverless API using AWS SAM (Serverless Application Model) while integrating real-time error monitoring and email alerts using CloudWatch Alarms and SNS. This pattern is ideal for production-ready serverless applications that need observability without heavy tooling. Project Structure The project includes the following core components: functions/: Contains the Lambda function that handles HTTP requests: app.mjs: Returns a simple response (e.g., “Hello World”). template.yaml: The SAM template defining resources including: Lambda Function (hello handler) API Gateway (to expose the function via HTTP) CloudWatch Alarm (monitors API 5XX errors) SNS Topic & Subscription (sends email alerts) How It Works This architecture sets up an API and monitors its availability in real time: ...