检索 ec2 清单时出现身份验证错误。已找到 AWS_ACCESS_KEY_ID 和 AWS_SECRET_ACCESS_KEY 环境变量,但可能不正确
Authentication error retrieving ec2 inventory. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment vars found but may not be correct
我们使用 Ansible 和 aws-cli 来部署、配置管理和编排我们的 application.It 是自动化这些过程的好方法。
不幸的是,有时(我无法准确指出时间,但在使用 ansible 几天后就会发生)我收到以下消息:
Authentication error retrieving ec2 inventory. AWS_ACCESS_KEY_ID and
AWS_SECRET_ACCESS_KEY environment vars found but may not be correct
我正在为 运行 ansible 使用 Ubuntu 14.04,我没有更改与 aws 访问密钥或秘密密钥相关的任何内容。我也尝试与 boto 一起工作,但行为相同。
唯一有帮助的是重新启动我的机器。
知道什么会导致这个问题吗?
谢谢,
效率
亚马逊的身份验证机制似乎使用了客户端时间戳,参见:http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#RESTAuthenticationTimeStamp
Time Stamp Requirement
A valid time stamp (using either the HTTP Date header or an x-amz-date alternative) is mandatory for
authenticated requests. Furthermore, the client timestamp included
with an authenticated request must be within 15 minutes of the Amazon
S3 system time when the request is received.
所以我用了 (https://askubuntu.com/questions/81293/what-is-the-command-to-update-time-and-date-from-internet):
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
为了更新我的日期时间,它已修复 :)
我假设它之前是 运行ning,现在它不工作了。确保您的 aws cli 参数已全部设置并且 aws 用户可以访问 运行 ansible 脚本。只需在您的机器上输入 运行 date 命令,看看您的时间是否正确。如果不是,请使用时间服务器更新您的机器时间,它应该可以解决您的问题。
我们使用 Ansible 和 aws-cli 来部署、配置管理和编排我们的 application.It 是自动化这些过程的好方法。
不幸的是,有时(我无法准确指出时间,但在使用 ansible 几天后就会发生)我收到以下消息:
Authentication error retrieving ec2 inventory. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment vars found but may not be correct
我正在为 运行 ansible 使用 Ubuntu 14.04,我没有更改与 aws 访问密钥或秘密密钥相关的任何内容。我也尝试与 boto 一起工作,但行为相同。
唯一有帮助的是重新启动我的机器。
知道什么会导致这个问题吗?
谢谢, 效率
亚马逊的身份验证机制似乎使用了客户端时间戳,参见:http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html#RESTAuthenticationTimeStamp
Time Stamp Requirement
A valid time stamp (using either the HTTP Date header or an x-amz-date alternative) is mandatory for authenticated requests. Furthermore, the client timestamp included with an authenticated request must be within 15 minutes of the Amazon S3 system time when the request is received.
所以我用了 (https://askubuntu.com/questions/81293/what-is-the-command-to-update-time-and-date-from-internet):
sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z"
为了更新我的日期时间,它已修复 :)
我假设它之前是 运行ning,现在它不工作了。确保您的 aws cli 参数已全部设置并且 aws 用户可以访问 运行 ansible 脚本。只需在您的机器上输入 运行 date 命令,看看您的时间是否正确。如果不是,请使用时间服务器更新您的机器时间,它应该可以解决您的问题。