Skip to content

shahLLL/serverless-image-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless-Image-Processing

This repository contains terraform infrastructure code that implements a serverless image processing system.

This codebase contains both the source and infrastructure code that are necessary for the system.

Overview ๐Ÿ‘€

System Architecture

Serverless is a cloud execution model where you write and deploy code without managing servers. The cloud provider automatically handles:

  • Infrastructure provisioning

  • Scaling up/down

  • High availability

  • Patch management

AWS Serverless Technology is used in this project. For a deeper dive please feel free to read this article.

Components

The following are the components used in this project:

  • Amazon S3: Amazon Simple Storage Service (Amazon S3) is an object storage service offering industry-leading scalability, data availability, security, and performance.
  • AWS Lambda: AWS Lambda is a compute service that runs your code in response to events and automatically manages the compute resources.
  • Amazon CloudWatch: CloudWatch is an intelligent observability service that provides actionable insights across applications and infrastructure.
  • Amazon DynamoDB: DynamoDB is a serverless, fully managed database that instantly scales to fit your applications' needs with zero infrastructure management, zero downtime maintenance, and zero maintenance windows.
  • AWS IAM: AWS Identity and Access Management (IAM) is a globally scoped AWS service that enables organizations to securely define, manage, and enforce fine-grained permissions for identities and resources, ensuring that the right principals have the appropriate level of access to AWS services and assets.
  • Amazon SNS: Amazon Simple Notification Service (SNS) is a fully managed, highly scalable publishโ€“subscribe messaging service that enables the decoupled, asynchronous delivery of messages and event notifications to multiple subscribers across distributed systems and applications.

Workflow

Below is the chain of events that occur in this architecture:

  1. User uploads image to Source S3 Bucket
  2. AWS Lambda Function gets triggered
  3. AWS Lambda Function runs image processing code
  4. CloudWatch monitors and collects logs from AWS Lambda Function
  5. AWS Lambda Function persists processed image to Destination S3 Bucket
  6. AWS Lambda Function persists metadata to DynamoDB Table
  7. AWS Lambda Function sends message to SNS Topic
  8. SNS Topic sends email to designated/provided email address

Pre-requistites ๐Ÿ“

The following are pre-requistes that are necessary to successfully use this package and deploy the desired infrastructure:

Usage ๐Ÿ› ๏ธ

Email

This project requires the user to specify an email address using terraform.tfvars file. Please follow the steps below:

  1. Create a file named terraform.tfvars file in the root directory
  2. Add email_endpoint="YOUR_EMAIL_ADDRESS" and save the file

Makefile

This project utlisies a Makefile for convinience and ease of development. The following are the commands that are pertinent to this project:

make init

Initializes the project

make run

Updates lambda source code

make plan

Displays planned changes

make deploy

Deploys desired infrastructure

make destroy

Removes deployed infrastructure

Forking & Contribution ๐Ÿด

This project is a great base for further development. Some ideas for extending/building upon this project:

๐ŸŒ Web & mobile apps

  • Profile photo resizing

  • Product image optimization

  • User-generated content pipelines

๐Ÿ›’ E-commerce

  • Dynamic product thumbnails

  • Watermarking

  • CDN-ready assets

๐Ÿ“ธ Media & SaaS platforms

  • Photo moderation

  • AI-based tagging

  • Searchable image libraries

๐Ÿ” Enterprise & compliance

  • Document image processing

  • Redaction & OCR

  • Audit-ready pipelines

Users are more than welcome to fork this repository and build upon it, however, do keep in mind the following: LICENSE

Likewise contributions to this repository are welcome as well but the intention is to keep this repository as a base serverless image processing system. Fully fledged products/systems should be in different repositories that have been forked from this one.

โ˜•โ˜•โ˜•CHEERS AND THANK YOUโ˜•โ˜•โ˜•

About

This is a repo that implements a serverless image processing system. Contains both source and infrastructure code

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors