Skip to content

Smilin01/serverless-image-pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Serverless Image Pipeline

This project implements a serverless pipeline that processes image uploads using AWS Lambda, S3, and SNS.

Architecture

Architecture Diagram

Flow Description

  1. Upload: A user uploads an image file to the configured S3 bucket.
  2. Trigger: The S3 upload event triggers the AWS Lambda function.
  3. Process: The Lambda function retrieves the object metadata (size, type) from S3.
  4. Notify: The function constructs a message and publishes it to an Amazon SNS topic.
  5. Log: Execution logs and errors are sent to Amazon CloudWatch.

Prerequisites

  • AWS Account
  • AWS CLI configured
  • Python 3.x installed

Setup & Deployment

  1. Create an S3 Bucket: Create a bucket to store your images.

  2. Create an SNS Topic: Create a Standard SNS topic and subscribe your email/SMS to it. Note the Topic ARN.

  3. Deploy Lambda Function:

    • Create a new Lambda function (Python 3.x runtime).
    • Copy the code from lambda_function.py into the function.
    • Add an S3 Trigger to the Lambda function, selecting your created bucket and event type All object create events.
  4. Configure Environment Variables: In the Lambda configuration, add the following environment variable:

    • SNS_TOPIC_ARN: The ARN of your SNS topic.
  5. IAM Permissions: Ensure the Lambda execution role has permissions to:

    • s3:GetObject and s3:ListBucket on your S3 bucket.
    • sns:Publish on your SNS topic.
    • logs:CreateLogGroup, logs:CreateLogStream, logs:PutLogEvents.

Usage

Upload an image to your S3 bucket. You should receive an SNS notification (Email/SMS) with the file details shortly after. Check CloudWatch Logs for execution details.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages