0% found this document useful (0 votes)
17 views2 pages

Serverless Image Uploader Guide

Uploaded by

TAIYABA FATHIMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Serverless Image Uploader Guide

Uploaded by

TAIYABA FATHIMA
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

■ Serverless Image Uploader with Notifications

(AWS Project Guide)


This guide walks you through building a fully functional serverless image uploader project using
AWS services such as S3, Lambda, API Gateway, SNS, EventBridge, and a simple HTML frontend.

1. Create S3 Bucket
- Go to S3 Console → Create Bucket - Name: image-uploader-taiyaba - Block all public access: ON
- Enable versioning (optional)

2. Create IAM Role for Lambda


- Go to IAM → Roles → Create Role → Lambda - Attach: AmazonS3FullAccess,
AmazonSNSFullAccess, CloudWatchLogsFullAccess - Name it: LambdaS3SNSRole

3. Create SNS Topic for Email Notification


- Go to SNS → Create Topic → Standard - Name: ImageUploadNotification - Add email
subscription and confirm via inbox.

4. Lambda #1: Generate Pre-Signed URL


- Create Lambda: GenerateUploadURLFunction (Python 3.12) - Use IAM Role:
LambdaS3SNSRole - Add code to generate pre-signed URL for upload (PUT) - Return URL via API
Gateway

5. Create API Gateway


- Create HTTP API → Route: GET /get-upload-url → Integration: GenerateUploadURLFunction -
Enable CORS (Allow-Origin: *) - Note the Invoke URL for frontend use

6. HTML Frontend
- Basic HTML with file input and upload button - Fetch pre-signed URL from API Gateway - Upload
image directly to S3 via PUT

7. Lambda #2: Process Uploaded Image


- Triggered by S3 (PUT in uploads/) - Resize image using PIL - Save resized image to resized/
folder - Send notification via SNS topic

8. EventBridge Scheduled Cleanup


- Create EventBridge schedule: every 1 day - Target: Lambda CleanupOldFiles - Deletes images
older than 7 days from resized/ folder

9. Test Flow
- Upload via HTML → S3 receives image → triggers Lambda - Lambda resizes image, stores it,
sends email - Logs are stored in CloudWatch - Daily cleanup runs via EventBridge

Final Notes:
All AWS services used are serverless and scale automatically. You can extend the project with
authentication, virus scanning, storage tiering, and more.

You might also like