I'm new to Boto3 and AWS API, and I want to get the list of buckets' names and the count of the available buckets in S3.
Any help is appreciated.
To get all buckets in your account:
import boto3
s3 = boto3.resource('s3')
bucket_list = [bucket.name for bucket in s3.buckets.all()]
print len(bucket_list)
print bucket_list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With