Created
May 25, 2018 17:00
-
-
Save cbodley/8a261b20cd4747ff83f4c99746cd2c74 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# create a bucket and enable versioning | |
import boto3 | |
import sys | |
# bucket name as first argument | |
bucketname = sys.argv[1] | |
endpoint='' | |
access_key='' | |
secret_key='' | |
s3 = boto3.resource('s3', | |
endpoint_url=endpoint, | |
aws_access_key_id=access_key, | |
aws_secret_access_key=secret_key) | |
bucket = s3.Bucket(bucketname) | |
bucket.create() | |
bucket.Versioning().enable() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment