Create S3 Bucket

Overview

In this step, you will create an S3 bucket to store invoice files uploaded by users. This bucket will be created in the us-east-1 region, and you will also configure an event notification to trigger a Lambda function whenever a new file is uploaded into a specific folder.


Step 1: Access S3 Console

  1. Log in to the AWS Console, search for S3, then select S3 from the results.

S3 Console

💡 Note: Before creating the bucket, make sure you have selected the correct region us-east-1 in the upper right corner of the AWS Console screen.
Creating the S3 bucket in the correct region is crucial for services like Lambda or Textract to work seamlessly.

  1. Click Create bucket to start creating a new one.

Create Bucket


Step 2: Configure the bucket

  1. Bucket name: invoice-upload-s3-bucket

Configure Bucket

💡 Note: Bucket names must be globally unique. You may add a suffix if the name is already taken, e.g., invoice-upload-s3-bucket-123456.

  1. In the Object Ownership section, select ACLs disabled.

  2. Block Public Access settings: keep default settings (all enabled) to ensure data is not public.

Block Public Access

  1. In the Bucket Versioning section, select Disabled.

Versioning

  1. In the Default encryption section, choose Amazon S3 managed keys (SSE-S3).

  2. Click Create bucket to finish.

Encryption

  1. Verify that the Bucket has been created.

Bucket


Step 3: Create the uploads/ folder

  1. Inside the newly created bucket, click Create folder.

Create Folder

  1. Name the folder: uploads

Create Folder

  1. Click Create folder to confirm.

Create Folder

  1. Verify that the folder has been created.

Create Folder


Step 7: Set up Event Notification

  1. Go to the Properties tab of the bucket.

Event Notifications

  1. Scroll down to Event notifications → select Create event notification.

Event Notifications

  1. Configure as follows:

    • Name: TriggerLambdaOnUpload
    • Prefix: uploads/
    • Suffix: (leave blank)
    • Event types: select PUT (All object create events)
    • Destination: select Lambda function
    • Lambda function: select UploadInvoiceFileFunction

Event Settings

Event Settings

Event Settings

  1. Click Save changes to complete the setup.

Event Settings

If you don’t see the Lambda function listed, make sure it was created in the correct region (us-east-1) and that the Lambda’s IAM role has the s3:PutBucketNotification permission.