by
0
7
3,604
4
Top 1% !
Popular
Famous
Tagged
Easy-to-find
Specified
OpenSource
Popularity: 3236th place
Created
Modified Aug 4, 2013
Architecturex86_64
LanguagePython
LicenseMIT_X11
Target Frameworkaws

Amazon S3 Aws - Listing Owned Buckets using boto api

This code returns  a list of Buckets that you own, invoking get\_all\_buckets() method. 
For each bucket you can get  name and creation date.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/4428/Amazon-S3-Aws---Listing-Owned-Buckets-us?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
import boto import boto.s3.connection access_key = 'put your access key here!' secret_key = 'put your secret key here!' # Setup Amazon S3 connection conn = boto.connect_s3( aws_access_key_id = access_key, aws_secret_access_key = secret_key) # Iteration on all buckets get from get_all_buckets() method # For each bucket object the name and creation date is shown for bucket in conn.get_all_buckets(): print "{name}\t{created}".format( name = bucket.name, created = bucket.creation_date, )

Other Steps and Solutions

If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus