Create S3 bucket

In this part, we will create two S3 buckets:

  • Bucket book-image-store: to store uploaded image
  • Bucket book-image-resize-store: to store iamge after resize
  1. Open Amazon S3 console

S3Console

  1. Click Create bucket

S3Console

  1. Enter bucket name, book-image-store
  • Choose the region closest to you.

CreateBucket

  1. Uncheck access block - Block all public access
  • Check the box - I acknowledge that the current settings might result in this bucket and the objects within becoming public

CreateBucket

  1. Click Create bucket

CreateBucket

  1. To create bucket - book-image-resize-store, repeat steps 1 to 5.
  2. After creating the two buckets, we add the trigger for the lambda function created earlier
  • Click Add Trigger

AddTrigger

  1. Enter S3 and select S3 service

AddTrigger

  1. Select bucket that trigger lambda, book-image-store
  • Select All object create events for Event type
  • Check the box - I acknowledge that using…. as shown below
  • Click Add

AddTrigger

  1. Check result after add trigger for Lambda function

Trigger