Boto 3 Resource

Resources are a higher-level abstraction compared to clients. They are generated from a JSON resource description that is present in the boto library itself. E.g. this is the resource definition for S3. Resources provide an object-oriented interface for interacting with various AWS services.

How to Create Boto 3 Resource:-

session=boto3.Session(aws_access_key_id=’’,aws_secret_access_key=’’)#Provide your access key and secret access key
s3 = session.resource(‘s3’)

How to get list of Buckets in Boto 3 Resource:-

for bucket in s3.buckets.all():
#Using this we can get all list of buckets present

How to Create Bucket in Boto 3 Resouce:-

print(f"Bucket Name '{Bucket_Name}'is Created")

How to Get Contents from Bucket in Resource:-

my_bucket = s3.Bucket(Bucket_Name)
except Exception as e:
for my_bucket_object in my_bucket.objects.all():




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium


How to Install Polr on Ubuntu 20.04 with LAMP

Inodes: A Starting Point for Understanding Linux Filesystems

A ship on cloud is moving to an earth

Python & SharePoint Folders

Start using Django with Flask

Automate Bank Reconciliations using Pandas library in Jupyter notebooks

kurplazo customer care number..7384970784.7384970784..

How to Find the Second Largest Element in a List in Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Hrishikesh Deshmukh

Hrishikesh Deshmukh

More from Medium

Amazon S3 for Beginners

PCEP Certification Prep — Tips and Thoughts

Python Institute — Jocquese Sanders

Advantage of AWS benefits.

Passing the AWS Certified Cloud Practitioner exam — A study guide