阅读背景:

如何使用aws cli命令设置--region?

来源:互联网 

I am trying to run the following command:

我正在尝试运行以下命令:

aws s3 cp --region ap-south-1 --acl public-read my.exe s3://bucket/binaries/my.exe

upload failed: ./my.exe to s3://bucket/binaries/my.exe A client error (InvalidRequest) occurred when calling the PutObject 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".

上载失败:./ my.exe到s3://bucket/binaries/my.exe调用PutObject操作时发生客户端错误(InvalidRequest):您正在尝试对需要签名版本4的区域中的存储桶进行操作。您可以通过使用--region参数,AWS_DEFAULT_REGION环境变量或AWS CLI配置文件中的区域变量显式提供正确的区域位置来解决此问题。您可以通过运行“aws s3api get-bucket-location --bucket BUCKET”来获取桶的位置。

How do I fix this error? I also tried the

我该如何解决这个错误?我也试过了

AWS_DEFAULT_REGION=ap-south-1 aws s3 cp --acl public-read my.exe s3://bucket/binaries/my.exe

but with no luck.

但没有运气。

# aws --version
aws-cli/1.10.28 Python/2.7.9 Linux/3.16.0-4-amd64 botocore/1.4.19

1 个解决方案

#1


1  

It seems to be working after upgrading awscli.

升级awscli后似乎正在工作。

pip install --upgrade awscli

aws --version
aws-cli/1.10.43 Python/2.7.9 Linux/3.16.0-4-amd64 botocore/1.4.33

分享到: