Skip to content

mathesh-me/image-resizing-using-s3-lambda-sns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Automated Image Resizing and Transfer System Using AWS Services

Project Description:

This project focuses on building an automated system for image processing and management within the AWS ecosystem. The goal is to streamline the handling of images by automatically resizing them and transferring them to a designated storage location while keeping stakeholders informed through notifications. Key AWS services, such as Lambda, S3, and SNS, are used to orchestrate this workflow.

Key Features:

  1. Image processing automation: Automatically resize and optimize images upon upload.
  2. Secure storage: Store processed images in a secure and reliable S3 bucket.
  3. Real-time notifications: Receive immediate updates about image processing via SNS.
  4. Scalable architecture: Design for scalability to handle image processing demands.
  5. Cost-efficient solution: Leverage AWS serverless technologies to minimize operational costs.

Overview :

a1

Steps :

Step 1 :

Creating Source and Designation s3 Buckets :

  1. Navigate to the S3 Console.
  2. Follow the Outlined Steps below.

i1

i2

i3

  1. Create the destination bucket using the same steps and name it with a unique name.

i4

  1. As you can see above , I created two buckets one is Source bucket and another one is Destination bucket.

Step 2 :

Creating the SNS Notification :

  1. Navigate to the SNS console.
  2. Follow the Outlined Steps below.

i5

i6

i7

i8

i9

i10 3. Scroll down and Click "Create subscription"
4. After this , you will receive some mail for Subscription Confirmation and you have to confirm that.
5. You can use any other protocols also like SQS, HTTP, SMS etc .,

i11

i12

i3

Step 3 :

Creating the Lambda :

  1. Navigate to the Lambda Console.
  2. Follow the Outlined steps below.

i14

i15

  1. Now replace the default code with the image-resizing-s3.py and deploy the changes , Don't test the code now we have to do some more actions before testing.
  2. After that , We have to give some permission for our Lambda Function to do our process (resizing) , For that navigate to the IAM Console and follow the below steps.

i16

i17

i18

i19

i20

i21

i22

  1. Now navigate to the Lambda Console and follow the steps below.

i23

i24

i25

  1. Now we have to trigger the function.

i26

i27

i28

  1. Now we have to go to code section , and scroll down to layers.
  2. We have to add layer .
  3. May be you can think , why ?
  4. It's because for resize the image we upload in our source S3 bucket , We need a python library called pillow in our code to resize the image . We can manually add Pillow library also, But it's very time consuming and you have to do lot more , Instead of manually adding pillow library we are going to use layers for Some easy action.
  5. Follow the outlined Steps below.

i51

i52 12.You can copy the arn from below.

arn:aws:lambda:ap-south-1:770693421928:layer:Klayers-p39-pillow:1
  1. After done all the actions above , now we can test our code.

i49

i50

  1. It will show some results like below , It runs successfully but return some error because we still not upload the images in S3 yet.

i50 1

Step 4 :

Results :

  1. Navigate to the S3 Console.
  2. Upload Some images in Source Bucket.

i29

i30

i31

i32

i33

i34

i35

It Successfully resized the Image and sends me the Notification.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages