by
2
8
4,539
1
Top 1% !
Popular
Famous
Tagged
Easy-to-find
Specified
Refined
OpenSource
Popularity: 1973rd place
Created
Modified Aug 4, 2013

Published on:

Architecturex86_64
LanguagePython
LicenseMIT_X11
Target Frameworkaws

Amazon S3 Aws - Creating a bucket in python

This code shows how to create a new bucket using boto API on a S3 Amazon account.   
Please note that the name of the bucket must be unique, different from any other bucket existing in Amazon S3 storage. For this reason you can add some random value to make it unique.
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/4892/Amazon-S3-Aws---Creating-a-bucket-in-pyt?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 = '<aws access key>' secret_key = '<aws secret key>' # This code initialize the Amazon S3 connection to your account conn = boto.connect_s3( aws_access_key_id = access_key, aws_secret_access_key = secret_key) # This creates a new bucket called myBucket bucket = conn.create_bucket('myBucket')

Other Steps and Solutions

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

blog comments powered by Disqus