Python Forum
boto3 Help Needed - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: boto3 Help Needed (/thread-37865.html)



boto3 Help Needed - gw1500se - Jul-30-2022

I'm just getting started with boto3 and AWS. I found this article and tried the sample code. I don't know if the sample code is wrong or if I need to be looking at something else. The bottom line is that the 'for' loop outputs nothing and I do not get any errors. Apparently 's3.buckets.all()' returns nothing. Is there a better, more accurate tutorial for getting started with boto3? TIA.

import boto3

s3 = boto3.resource('s3')

for bucket in s3.buckets.all():
    print(bucket.name)