Skip to content

How To get AWS S3 Bucket lists Using Python Boto3

AWS S3 boto3 complete guide
Share

Reading Time: < 1 minute

This tutorial will guide you on How To get AWS S3 Bucket lists Using Python Boto3. We consider you already have an AWS account however if you do not have please follow the below tutorial to create an AWS account. Once you have an AWS account, You may proceed to create an AWS S3 bucket using Python. You should also create/grant AWS CLI access. Python boto3 is a powerful python module that can be used programmatically to create and view AWS resources.

If you have not created S3 Bucket yet, You should create S3 bucket first and this tutorial “How To Create AWS S3 Bucket Using Python Boto3

How To get AWS S3 Bucket lists Using Python Boto3

import boto3
import logging
s3 = boto3.client('s3')
response = s3.list_buckets()
# Output the bucket names
print('Existing buckets:')
for bucket in response['Buckets']:
    print(f'  {bucket["Name"]}')
    
response

for bucket in response['Buckets']:
    print(f' "Bucket Name : " {bucket["Name"]}')
    print(f' "Create Date : " {bucket["CreationDate"]}')
How To get AWS S3 Bucket lists Using Python Boto3

You can also learn “How to create EC2 instance

You can also learn “How to describe EC2 instance using Python boto3

S3 Official website


Share

Leave a Reply

Your email address will not be published. Required fields are marked *

?>