Replibyte
Replibyte copied to clipboard
Cannot create S3 bucket in us-east-1 region
I've noticed I'm not able to initialize an S3 bucket in the us-east-1
region.
My replibyte.yaml
:
datastore:
aws:
bucket: $S3_BUCKET
region: $S3_REGION
access_key_id: $S3_ACCESS_KEY_ID
secret_access_key: $S3_SECRET_ACCESS_KEY
Running replibyte -c replibyte.yaml dump list
with S3_BUCKET=us-east-1
results in this error:
[2022-05-14T03:13:11Z ERROR replibyte::datastore::s3] Error { code: "InvalidLocationConstraint", message: "The specified location-constraint is not valid", request_id: "...", s3_extended_request_id: "..." }
failed to create bucket 'replibyte'
But the command works fine with S3_BUCKET=us-east-2
and creates the bucket as expected.
I've attempted a workaround (https://github.com/mumumumu/replibyte/commit/c6eff63c5adb81756ab17dd28a05e074fc27e8ff), and it works, but I'm not sure if there's a better way to handle this (I'm not really a rust dev 😅).
Found this in the AWS docs:
If you don't specify a Region, the bucket is created in the US East (N. Virginia) Region (us-east-1)
It seems like you must not specify a region in order to create a bucket in us-east-1
, at least with the Rust SDK.
Indeed, it's a strange issue. @benny-n @fabriceclementz did you experience something similar? 🤔
@evoxmusic Since I don't have an available AWS account, I don't think I can reproduce this error 😕
In the commands the OP is using they are using: S3_BUCKET=us-east-1
which is the name of a region but they are specifying it as the bucket name, shouldn't they be using S3_REGION=us-east-1
?