Skip to content

Commit 940e5e2

Browse files
committed
listing s3 buckets
1 parent 4f2444a commit 940e5e2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

boto3_eg/list_s3_buckets.py

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import boto3
2+
3+
session = boto3.session.Session(profile_name="default",region_name="aps-south-1")
4+
s3 = session.client(service_name="s3",region_name="ap-south-1")
5+
6+
for each_bucket in s3.list_buckets()['Buckets']:
7+
print(each_bucket["Name"])

0 commit comments

Comments
 (0)