2017-03-18 78 views
1

我想将我的所有数据从账户ABucket1移动到账户BBucket2aws cli签名版本4

对于这一点:

  1. 我下载AWS CLI的Windows。
  2. 进入IAM凭据使用命令aws configure(这些凭据是从帐户B
  3. 运行命令同步桶:aws s3 sync s3://Bucket1 s3://Bucket2

    我收到以下错误:

fatal error: An error occured (InvalidRequest) when calling the ListObject operation: You are attempting to operate on a bucket in a region that requires Signature Version 4. You can fix this issue by explicitly providing the correct region location using the --region argument, the AWS_DEFAULT_REGION environment variable, or the region variable in the AWS CLI configuration file. You can get the bucket's location by running "aws s3api get-bucket-location --bucket BUCKET".

如何应对这个错误?

aws --version 
aws-cli/1.11.61 Python/2.7.9 windows/8 botocore/1.5.24 
+0

正如错误所述,你应该在你的'aws s3 sync'命令中加一个'--region'参数。我认为你需要引用*目标*区域,但如果这不起作用,请尝试*源*区域。它将采用“us-east-1”或“us-west-2”的格式。你在使用哪个区域? –

+0

如何添加区域参数(语法)?我在命令'aws --region us-west-2'收到'太少参数'错误' –

+0

'aws s3 sync s3:// Bucket1 s3:// Bucket2 --region us-west-2' –

回答

1

S3网址是这样的:https://console.aws.amazon.com/s3/home?region=us-east-1 所以我推测us-east-1是我区,但实际上它不是!

我用AWS命令找到Bucket2区域,它告诉我一个不同的区域。

然后我用这个命令aws s3 sync s3://Bucket1 s3://Bucket2 --region Asia Pacific (Mumbai)和一切工作正常!