An end-to-end serverless image processing solution built with Amazon S3, Amazon SNS, Amazon SQS, AWS Lambda, and Amazon CloudWatch.
The project demonstrates an event-driven architecture that automatically processes uploaded images using fully managed AWS serverless services.
This lab demonstrates how an image uploaded to Amazon S3 automatically triggers a serverless processing pipeline. The solution uses Amazon SNS to distribute notifications, Amazon SQS to decouple processing, and AWS Lambda functions to generate multiple image sizes.
The following diagram illustrates the serverless event-driven architecture implemented in this lab.
The solution follows an event-driven architecture in which image uploads automatically trigger a serverless processing pipeline.
- An image is uploaded to the
ingest/folder in Amazon S3. - Amazon S3 publishes an event notification to an Amazon SNS topic.
- Amazon SNS distributes the event to three Amazon SQS queues using the fan-out pattern.
- Each Amazon SQS queue triggers a dedicated AWS Lambda function.
- The Lambda functions generate thumbnail, web, and mobile versions of the image.
- The processed images are stored in Amazon S3, and execution logs are recorded in Amazon CloudWatch.
The Amazon S3 bucket is configured to publish an event notification whenever a .jpg image is uploaded to the ingest/ folder. The notification is sent to an Amazon SNS topic, initiating the serverless image processing workflow.
Amazon SNS distributes image upload events to multiple Amazon SQS queues using the publish/subscribe pattern. This fan-out architecture enables independent and scalable processing pipelines.
Three Amazon SQS queues decouple the image processing workflow. Each queue triggers a dedicated AWS Lambda function responsible for generating a specific image size.
thumbnail-queueweb-queuemobile-queue
The solution uses three AWS Lambda functions to process images asynchronously. Each function is responsible for generating a different output size after receiving messages from its dedicated Amazon SQS queue.
- CreateThumbnail – Generates thumbnail-sized images.
- CreateWebImage – Generates web-optimized images.
- CreateMobileImage – Generates mobile-sized images.
The CreateThumbnail Lambda function is triggered by Amazon SQS and resizes uploaded images using the Pillow library. The processed thumbnail is then stored back in Amazon S3.
The Amazon S3 bucket is organized into separate folders for the original uploads and the processed images generated by the Lambda functions.
ingest/– Original uploaded imagesthumbnail/– Thumbnail-sized imagesweb/– Web-optimized imagesmobile/– Mobile-sized images
CloudWatch Logs confirm the successful execution of the CreateThumbnail Lambda function after an image upload.
The logs show the complete invocation lifecycle (INIT_START → START → END → REPORT) and confirm that the image ingest/InputFile.jpg was processed successfully.
| Service | Purpose |
|---|---|
| Amazon S3 | Store original and processed images |
| Amazon SNS | Publish image upload events |
| Amazon SQS | Queue messages for asynchronous processing |
| AWS Lambda | Resize uploaded images |
| Amazon CloudWatch | Logging and monitoring |
| IAM | Grant permissions between AWS services |
- Event-driven architecture
- Amazon S3 Event Notifications
- Amazon SNS fan-out messaging
- Amazon SQS message decoupling
- AWS Lambda image processing
- Automatic image resizing
- Amazon CloudWatch monitoring
- Serverless architecture
- Python-based image manipulation
1. Upload image (.jpg)
│
▼
2. Amazon S3 Event Notification
│
▼
3. Amazon SNS Topic
│
├──────────────┐
│ │
▼ ▼
Thumbnail Queue Web Queue Mobile Queue
│ │ │
▼ ▼ ▼
Lambda #1 Lambda #2 Lambda #3
│
▼
4. Resized images stored in S3
│
▼
5. Logs available in Amazon CloudWatch
.
├── README.md
├── LICENSE
├── architecture/
│ └── architecture.png
└── screenshots/
├── s3-event-notification.png
├── sns-sqs-integration.png
├── sqs-queues.png
├── lambda-functions.png
├── lambda-thumbnail.png
├── s3-bucket-structure.png
└── cloudwatch-logs.png
- AWS Serverless
- Event-Driven Architecture
- Distributed Systems
- Amazon SNS
- Amazon SQS
- Publish/Subscribe Pattern
- Fan-out Pattern
- Asynchronous Messaging
- AWS Lambda
- Event-driven Functions
- Serverless Processing
- Amazon S3
- Event Notifications
- Amazon CloudWatch
- Log Analysis
- Python 3.11
- Image Processing
- AWS SDK (Boto3)
- Amazon S3
- Amazon SNS
- Amazon SQS
- AWS Lambda
- Amazon CloudWatch
- IAM
- Python 3.11
- Boto3
- Pillow (PIL)
By completing this lab, I gained hands-on experience with:
- Designing event-driven architectures
- Building serverless applications
- Decoupling distributed systems
- Processing asynchronous workloads
- Monitoring Lambda executions
- Integrating multiple AWS managed services
Ze Mendes
Information Security Analyst with experience in cloud infrastructure, cybersecurity, automation, and governance.
- GitHub: https://github.com/zcmendes
- LinkedIn: https://www.linkedin.com/in/zcmendes






