Skip to content

Add a location constraint for bucket creation. - #78

Open
sonoransun wants to merge 1 commit into
masterfrom
bugfix/add-location-constraint-for-s3-access
Open

Add a location constraint for bucket creation.#78
sonoransun wants to merge 1 commit into
masterfrom
bugfix/add-location-constraint-for-s3-access

Conversation

@sonoransun

Copy link
Copy Markdown
Contributor

The only region where a location constraint is not required is us-east-1.

Comment thread lib/s3.py
if e.response['Error']['Code'] == 'NoSuchBucket' or int(e.response['Error']['Code']) in [403, 404]:
# Create the bucket since it does not exist
s3_client.create_bucket(Bucket=bucket)
s3_client.create_bucket(Bucket=bucket, CreateBucketConfiguration={'LocationConstraint': region})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should set this to default to eu-west-1 if the paramter is missing in the env? I think that would make line 11 region = os.getenv('AWS_DEFAULT_REGION', 'eu-west-1')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants