我已经设置了 CLI,以便[default]
是我的工作帐户,[jacoblambert]
是我的个人帐户。当我尝试使用以下命令访问S3
时:
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 集成文件中设置的(我拔出了密钥):
~ $ 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
,我仍然会遇到相同的错误。
您确定由于out of date
找到了根本原因吗?
您报告的问题与 Amazon S3 签名版本 4 身份验证特定策略密钥有关
你应该可以用命令修复
aws configure set profile.jacoblambert.s3.signature_version s3v4
或将以下行添加到该配置文件[jacoblambert]
~/.aws/config 中
s3 =
signature_version = s3v4
指:
在请求身份验证中指定签名版本
该问题是由于我的 CLI 已过时引起的。