Skip to content

Commit 93995d9

Browse files
author
Matthew Fisher
authored
Merge pull request #187 from aboyett/fix-s3-us-east-1
fix(create_bucket): avoid S3 InvalidLocationConstraint error
2 parents 84fce10 + 5188f77 commit 93995d9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rootfs/bin/create_bucket

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ if os.getenv('DATABASE_STORAGE') == "s3":
2626
conn = boto.s3.connect_to_region(region)
2727
if not bucket_exists(conn, bucket_name):
2828
try:
29-
conn.create_bucket(bucket_name, location=region)
29+
if region == "us-east-1":
30+
# use "US Standard" region. workaround for https://github.com/boto/boto3/issues/125
31+
conn.create_bucket(bucket_name)
32+
else:
33+
conn.create_bucket(bucket_name, location=region)
3034
# NOTE(bacongobbler): for versions prior to v2.9.0, the bucket is created in the default region.
3135
# if we got here, we need to propagate "us-east-1" into WALE_S3_ENDPOINT because the bucket
3236
# exists in a different region and we cannot find it.

0 commit comments

Comments
 (0)