我想將我的所有數據從賬戶A
的Bucket1
移動到賬戶B
的Bucket2
。aws cli簽名版本4
對於這一點:
- 我下載
AWS CLI
的Windows。 - 進入
IAM
憑據使用命令aws configure
(這些憑據是從帳戶B
) 運行命令同步桶:
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
正如錯誤所述,你應該在你的'aws s3 sync'命令中加一個'--region'參數。我認爲你需要引用*目標*區域,但如果這不起作用,請嘗試*源*區域。它將採用「us-east-1」或「us-west-2」的格式。你在使用哪個區域? –
如何添加區域參數(語法)?我在命令'aws --region us-west-2'收到'太少參數'錯誤' –
'aws s3 sync s3:// Bucket1 s3:// Bucket2 --region us-west-2' –