【问题标题】:Eb tools with multiple aws accounts具有多个 aws 帐户的 Eb 工具
【发布时间】:2015-07-25 18:44:45
【问题描述】:
是否可以在同一台机器上使用 Elastic Beanstalk 工具和两个单独的 aws 帐户?
更多说明:
按照here 所述安装弹性beantalk 工具后,我可以使用
在我的项目中初始化设置
eb init
并提供 aws id 和 secret。此时一切都很好。
这里的问题是凭据会自动存储在 ~/.aws/config 中,并在执行 eb 命令时读取。
我有第二个 AWS 账户,也想在那里使用 eb 工具。是否可以让 eb 工具使用自定义配置文件?我在文档here
中找不到任何内容
谢谢。
【问题讨论】:
标签:
ubuntu
amazon-web-services
amazon-elastic-beanstalk
aws-sdk
【解决方案1】:
是的,您可以使用 EB 工具创建多个配置文件。
要创建新的配置文件,您可以使用
aws configure --profile <your-profile-name>
它将在~/.aws/credentials 和~/.aws/config 中生成一个新的配置文件。或者,您可以手动编辑这些文件。请阅读文档here。
生成配置文件后,您可以将--profile <your-profile-name> 附加到您的eb init 命令:
eb init --profile <your-profile-name>
它将生成一个配置文件 (.elasticbeanstalk/config.yml)。之后,如果要部署,只需使用:
eb deploy