我有我的CLI设置,以便[default]
用于我的帐户在工作和[jacoblambert]
是我的个人帐户。当我尝试使用下面的命令来访问S3
:AWS 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
,我仍然遇到了同样的犯错要么。
我的AWS-CLI版本是'aws-cli/1.10.34'。升级到'aws-cli/1.11.82'后,我不再有这个问题。对我来说,这个问题似乎是一个过时的CLI安装。 – JRLambert
好的,但我仍然不同意升级aws cli可以解决这个问题。 – BMW