AWS CLI身份验证

时间:2015-08-23 09:07:02

标签: amazon-web-services amazon-ec2

我在我的cygwin上安装了aws cli,创建了一个IAM用户,下载了其访问密钥信息。

~/.aws/credentials包含

中的

[default]
aws_access_key_id = xxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

~/.aws/config包含

[default]
region = us-east-1
output = text

但我收到身份验证错误:

$ aws ec2 describe-regions
A client error (AuthFailure) occurred when calling the DescribeRegions operation: AWS was not able to validate the provided access credentials

知道我哪里错了吗?

2 个答案:

答案 0 :(得分:0)

查看How to get AWS command line interface to work in cygwin - 它声称它在AWS_CONFIG_FILE环境变量中查找凭据,而不是〜/ .aws /

另外,如果适用于http://aws.amazon.com/powershell/

,还有CLI的PowerShell版本

答案 1 :(得分:0)

我会检查$ PATH是否在〜/ .bashrc中正确导出,如果没有添加下面的行,如果还没有那么。

export PATH="$PATH:$HOME/.aws"

要在用户登录时进行检查,请尝试

#echo $aws_access_key_id
#echo $aws_secret_access_key 
在shell上

确认他们正在显示凭据。 如果您仍然无法继续尝试使用命令

再次添加凭据
#aws configure
祝你好运,希望有所帮助。