2017-05-04 73 views
0

我有我的CLI设置,以便[default]用于我的帐户在工作和[jacoblambert]是我的个人帐户。当我尝试使用下面的命令来访问S3AWS CLI不读取配置文件

aws --profile jacoblambert s3 ls 

我遇到了以下错误:

A client error (InvalidRequest) occurred when calling the GetBucketLocation 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. 

但事实是,在region变量在AWS CLI congifuration文件设置(我掏出钥匙):

~ $ aws configure list --profile jacoblambert 
    Name     Value    Type Location 
    ----     -----    ---- -------- 
profile    jacoblambert   manual --profile 
region    us-east-2  config-file ~/.aws/config 

如果我在aws s3命令中指定--region us-east-2,我仍然遇到了同样的犯错要么。

回答

0

该问题是由我的CLI过期引起的。

0

您确定找到根本原因吗?out of date

您报告的问题是关于Amazon S3 Signature Version 4 Authentication Specific Policy Keys

你应该罚款与命令

aws configure set profile.jacoblambert.s3.signature_version s3v4 

修复或以下线在〜/ .aws /配置

s3 = 
    signature_version = s3v4 
添加到该配置文件 [jacoblambert]

参考:

Specifying Signature Version in Request Authentication

+0

我的AWS-CLI版本是'aws-cli/1.10.34'。升级到'aws-cli/1.11.82'后,我不再有这个问题。对我来说,这个问题似乎是一个过时的CLI安装。 – JRLambert

+0

好的,但我仍然不同意升级aws cli可以解决这个问题。 – BMW