π Event-Driven Product Processing System (AWS Serverless)
This project demonstrates a serverless event-driven architecture using AWS services like API Gateway, Lambda, SQS, and DynamoDB.

π§© Architecture Overview
Flow:
User β API Gateway β ProductProcess Lambda β SQS β ProductLoader Lambda β DynamoDB
Additional:
- CloudWatch β Logging & Monitoring
βοΈ Technologies Used
- AWS API Gateway
- AWS Lambda (Python Runtime)
- AWS SQS (Queue)
- AWS DynamoDB
- AWS CloudWatch
- IAM Roles & Policies
- Postman (Testing)
π Reference Code
GitHub Repository: π https://github.com/ShubhamJoshi-dev/Event-Driven-Product-Processing-Lambda.git
π§ Step-by-Step Setup
1οΈβ£ Create API Gateway
- Go to API Gateway
- Create API
- Create Resource (e.g.,
/product) - Inside resource β Create Method β
POST - Enable CORS
- Deploy API
2οΈβ£ Create First Lambda (ProductProcess)
-
Runtime: Python
-
Create new IAM Role
-
Add permissions for:
- SQS
- CloudWatch Logs
Lambda Configuration:
-
Timeout: 15 minutes (General config)
-
Add Environment Variables:
SQS_URL= your SQS queue URLTABLE_NAME= DynamoDB table name
π Paste processor code from repo
3οΈβ£ Integrate API Gateway with Lambda
- Connect POST method to ProductProcess Lambda
- Deploy API
4οΈβ£ Test Using Postman
- Send POST request:
POST /product
- Check Lambda logs in CloudWatch
5οΈβ£ Create SQS Queue
- Go to SQS
- Create Queue
- Copy Queue URL
- Add URL to Lambda Environment Variable (
SQS_URL)
6οΈβ£ Create Second Lambda (ProductLoader)
- Runtime: Python
- Create new IAM Role
Add Permissions:
- SQS
- DynamoDB
- CloudWatch
Configuration:
- Timeout: 2 minutes
- Add Environment Variables (if required)
π Paste loader code from repo
7οΈβ£ Connect SQS to Lambda (Trigger)
- Go to ProductLoader Lambda
- Add Trigger β SQS
- Select your queue
β οΈ If trigger not working:
- Reduce Lambda timeout first
- Attach trigger
- Then increase timeout if needed
8οΈβ£ Create DynamoDB Table
- Create table (e.g.,
Products) - Add table name in ProductProcess Lambda ENV
β Final Flow Testing
POST Request
-
Send POST request from Postman
-
Flow:
- API Gateway β Lambda β SQS β Loader Lambda β DynamoDB
β Data should be stored in DynamoDB
GET Request
- Add GET method in API Gateway
- Integrate with Lambda (optional)
- Fetch data from DynamoDB
π Monitoring
Use CloudWatch for:
- Logs
- Debugging
- Execution tracking
β οΈ Important Notes
- Always enable CORS in API Gateway
- Use environment variables instead of hardcoding
- Ensure correct IAM permissions
- Timeout settings matter for Lambda execution
π― Conclusion
This architecture ensures:
- Loose coupling (via SQS)
- Scalability
- Fault tolerance
- Serverless cost efficiency
π Credits
Reference Implementation: https://github.com/ShubhamJoshi-dev/Event-Driven-Product-Processing-Lambda.git
π₯ Your event-driven system is now ready!