Beijing (China) region is quite unique as almost everything of it is separate (from AWS Global). For instance, to use AWS CLI to list the objects we have to specify region and endpoint-url:
aws --region cn-north-1 \
--endpoint-url https://s3.cn-north-1.amazonaws.com.cn \
--profile AN_AWS_CN_PROFILE \
s3 ls s3://AN_AWS_CN_BUCKET/
My question is how can I sync data between a Beijing (China) bucket and a global one? To begin with, a global bucket is not recognised with the specified region & endpoint-url above. For example,
aws --region cn-north-1 \
--endpoint-url https://s3.cn-north-1.amazonaws.com.cn \
--profile AN_AWS_CN_PROFILE \
s3 cp s3://AN_AWS_CN_BUCKET/ s3://AN_AWS_IRELAND_BUCKET/
will give
fatal error: An error occurred (NoSuchBucket) when calling the ListObjects operation: The specified bucket does not exist
(The destination bucket does exist.)
So far I've explored CLI arguments, and .aws/config file to define profiles. Maybe it is possible to use multiple profile in a single command, but it doesn't seem possible to config endpoint-url in the .aws/config, as it is not mentioned here.
Now I just copy files to local then upload which would become an issue as the dataset grows quickly. Using EMR may resolve the scaling issue, but it adds an extra layer of complexity. I wonder if there's a better and possibly easy solution? Thank you.