【发布时间】:2016-11-18 07:41:17
【问题描述】:
一个月左右,我一直在研究 AWS 服务,现在我必须通过命令行完成一些关于 AWS elastic beanstalk 的基本工作。据我了解,构建实例上安装了 aws elasticbeanstalk [command] 和 eb [command] CLI。
当我在应用程序文件夹中运行 eb status 时,我会收到以下表单的响应:
Environment details for: app-name
Application name: app-name
Region: us-east-1
Deployed Version: app-version
Environment ID: env-name
Platform: 64bit Amazon Linux ........
Tier: WebServer-Standard
CNAME: app-name.elasticbeanstalk.com
Updated: 2016-07-14 .......
Status: Ready
Health: Green
这告诉我 eb init 已为应用程序运行。
另一方面,如果我运行:
aws elasticbeanstalk describe-application-versions --application-name app-name --region us-east-1
我得到错误:
Unable to locate credentials. You can configure credentials by running "aws configure".
在当前用户的主文件夹中有一个 .aws 目录,其中包含一个凭证文件,其中包含 [profile] 行和 aws_access_key_id 和 aws_secret_access_key 行全部设置。
除了凭证的明显问题之外,我真正缺乏的是对这两个 cli 的理解。为什么 EB cli 不要求提供凭证而 AWS cli 要求提供?我什么时候使用其中一个?我可以只使用 aws cli 吗?对此事的任何澄清将不胜感激。
编辑:
对于任何在这里结束的人,都遇到了与“无法找到凭据”相同的问题。添加 --profile profile-name 选项为我解决了这个问题。 profile-name 可以在 ~/.aws/config(或凭据)文件的 [profile profile-name] 行中找到。
【问题讨论】:
-
您后来的编辑为我节省了一天。谢谢!
标签: amazon-web-services amazon-elastic-beanstalk aws-cli ebcli