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.
post this code
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')
If you want to be updated about similar snippets,
and follow our Channels