To list the S3 Buckets inside an AWS Account, you will need to use the
list_buckets() method of boto3.
Below are two example codes that you can use to retrieve all S3 buckets inside a Amazon Web Services account.
Both example scripts will do that same thing. It will query AWS for all the S3 Buckets inside the account and return the buckets names in a Python list.
Since both will do the same thing, you can use whichever method you prefer.Continue reading How to list all S3 Buckets using Python boto3