An event-driven serverless application that automatically resizes uploaded images using AWS Lambda and stores the processed images back into Amazon S3 while sending real-time email notifications through Amazon SNS.
Modern cloud applications should respond automatically to events without requiring dedicated servers. This project demonstrates how AWS Serverless services can be combined to build a scalable, automated image processing pipeline.
Whenever a user uploads an image into an Amazon S3 bucket, the application automatically:
- Detects the uploaded image
- Invokes an AWS Lambda function
- Resizes the image using the Pillow library
- Stores the processed image in another folder
- Sends an email notification using Amazon SNS
- Records execution logs in Amazon CloudWatch
This project showcases how event-driven architectures can eliminate manual intervention while providing scalability, reliability, and low operational overhead.
- Build a fully serverless image processing application.
- Learn AWS event-driven architecture.
- Automate image resizing using AWS Lambda.
- Store original and processed images in Amazon S3.
- Implement email notifications using Amazon SNS.
- Monitor application execution using Amazon CloudWatch.
- Apply IAM best practices for secure service communication.
User
│
▼
Upload Image (.jpg)
│
▼
Amazon S3 Bucket
uploads/
│
▼
S3 Event Notification
│
▼
AWS Lambda Function
│
┌───────────┴───────────┐
▼ ▼
Resize Image Amazon SNS
│ │
▼ ▼
processed/ Email Notification
│
▼
Amazon CloudWatch Logs
| Service | Purpose |
|---|---|
| Amazon S3 | Store original and processed images |
| AWS Lambda | Execute image processing logic |
| AWS IAM | Secure service permissions |
| Amazon SNS | Send email notifications |
| Amazon CloudWatch | Monitor logs and execution |
| Lambda Layer | Package the Pillow library |
- Event-driven image processing
- Fully serverless architecture
- Automatic image resizing
- Email notifications
- CloudWatch logging
- Secure IAM Role configuration
- Lambda Layer for dependency management
- Scalable and cost-effective solution
- User uploads an image to the uploads/ folder in Amazon S3.
- Amazon S3 generates an Object Created event.
- The event triggers the AWS Lambda function.
- Lambda downloads the uploaded image.
- The Pillow library resizes the image.
- The processed image is uploaded to the processed/ folder.
- Amazon SNS sends an email notification.
- CloudWatch records execution logs.
aws-serverless-image-processing/
├── README.md
├── LICENSE
├── .gitignore
│
├── lambda/
│ ├── lambda_function.py
│ └── requirements.txt
│
├── docs/
│ ├── deployment-guide.md
│ ├── architecture.md
│ └── troubleshooting.md
│
├── architecture/
│ └── architecture-diagram.png
│
├── screenshots/
│
└── images/
This project follows an event-driven serverless architecture, where AWS services communicate automatically without requiring dedicated servers.
- Event-driven processing using Amazon S3 Event Notifications
- Fully serverless compute using AWS Lambda
- Secure access management with IAM Roles
- Dependency management using Lambda Layers
- Automatic notifications through Amazon SNS
- Centralized logging with Amazon CloudWatch
Follow these steps to deploy the project:
Create an IAM Role for Lambda.
Attach appropriate permissions for:
- Amazon S3
- Amazon SNS
- CloudWatch Logs
Create an Amazon S3 bucket.
Inside the bucket create two folders.
uploads/
processed/
Create an Amazon SNS Topic.
Subscribe your email address and confirm the subscription.
Create the Pillow Lambda Layer.
Attach the layer to the Lambda Function.
Create the Lambda Function.
Configure:
- Runtime
- IAM Role
- Environment Variables
- Lambda Layer
Configure Amazon S3 Event Notification.
Trigger:
Object Created
Prefix:
uploads/
Suffix:
.jpg
Destination:
AWS Lambda
Upload an image inside
uploads/
The application will automatically process the image.
Successful deployment can be verified by checking:
- Processed image available in processed/
- SNS email received
- CloudWatch execution logs generated
- Lambda invocation successful
This project demonstrates practical experience with:
- Amazon S3
- AWS Lambda
- Lambda Layers
- Amazon SNS
- Amazon CloudWatch
- IAM Roles & Policies
- Event-Driven Architecture
- Serverless Computing
- Python Automation
- Cloud Monitoring
Future improvements planned for this project:
- Support PNG and WebP images
- Image compression
- Watermarking
- Image metadata extraction
- Multiple image resolutions
- Infrastructure as Code using Terraform
- CI/CD deployment using Jenkins
- Containerized image processing using Docker
- Monitoring dashboard using CloudWatch Metrics
The screenshots below demonstrate the successful implementation of the project.
| Screenshot | Description |
|---|---|
| S3 Bucket | Bucket configuration |
| IAM Role | Lambda execution role |
| SNS Topic | Email notification service |
| Lambda Layer | Pillow dependency |
| Lambda Function | Processing logic |
| S3 Trigger | Event notification |
| CloudWatch Logs | Execution logs |
| Processed Image | Output verification |
| Email Notification | Successful processing |
Additional documentation is available inside the docs/ directory.
- Deployment Guide
- Architecture Documentation
- Troubleshooting Guide