Aws-cli: `S3` API in HK region (ap-east-1) cannot work normally

Created on 22 May 2019  路  4Comments  路  Source: aws/aws-cli

We try to use aws s3 cp s3://HK-BUCKET-NAME s3://JP-BUCKET-NAME but failed.

aws s3 cp s3://hk-bucket1/config.js s3://jp-bucket1/config.js --profile=demo
copy failed: s3://hk-bucket1/config.js to s3://jp-bucket1/config.js An error occurred (IllegalLocationConstraintException) when calling the CopyObject operation: The ap-northeast-1 location constraint is incompatible for the region specific endpoint this request was sent to.

And only if we add --region={dest_region_id}, this command will work:

aws s3 cp s3://hk-bucket1/config.js s3://jp-bucket1/config.js --profile=demo --region=ap-northeast-1
copy: s3://hk-bucket1/config.js to s3://jp-bucket1/config.js

I know we changed the endpoint setting in HK API because of the particularity of HK. But if we can change it will be better.

Most helpful comment

I have the same problem.
Have you solved this problem?

Using --region and --source-region to set the target region and source region. It works.

All 4 comments

This is expected behavior. The CopyObject requests must be sent to the destination region. If you have configured your default region to be the source region, then you will need to do an override. Depending on your circumstances, it may also be necessary to specify the source region with --source-region

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

I have the same problem.
Have you solved this problem?

I have the same problem.
Have you solved this problem?

Using --region and --source-region to set the target region and source region. It works.

Was this page helpful?
0 / 5 - 0 ratings