Step-By-Step Guide to Read Files Content from S3 Bucket
Steps to Create S3 Buckets and Upload Files and Folders
Step 1: Login into the AWS console.
Step 2: After signing in, you will land on the AWS Management Console page and search for S3 as shown below.
Step 3: From the sidebar go to Buckets. Click on Create bucket this will create a bucket.
Step 4: Enter your bucket name, make sure your bucket name is unique.
Step 5: Create bucket, no need to change other things keep them as it is.
Step 6: Goto buckets page again, this will list all buckets.
Step 7: We will upload and read files from ‘gfg-s3-test-bucket‘. Open your bucket.
Step 8: Click on the Upload button. You can also Create Folder inside buckthe et. Select Add File/ Folder to add them.
Step 9: Verify if files/folders added properly or not, then Upload it.
- Content of Test.txt
Test.txt is running
GFG Test
- Content of Test1.txt
Test1.txt is running
Reading contents from file using boto3
Step 10: All the files are uploaded successfully, now we can start reading those using Boto3.
How to Read File Content from S3 Bucket with Boto3 ?
AWS S3 (Simple Storage Service), a scalable and secure object storage service, is often the go-to solution for storing and retrieving any amount of data, at any time, from anywhere. Boto3 is the AWS Software Development Kit (SDK) for Python, which provides an object-oriented API for AWS infrastructure services. It allows Python developers to build applications on top of Amazon services.