阅读背景:

aws eb cli 3设置了错误帐户的申请

来源:互联网 

I have multiple AWS accounts and I'm trying out the new command line interface for elastic beanstalk EB CLI 3. When I run the following command eb init I get prompted for the region (good) and then it asks me to "Select an application to use" where it lists the applications from another AWS account (for staging). If I go ahead and "Create new application" that application will be created in my staging account.

我有多个AWS账户,我正在为弹性beanstalk EB CLI 3尝试新的命令行界面。当我运行以下命令eb init时,我被提示输入该区域(好),然后它要求我“选择一个应用程序使用“它列出来自另一个AWS账户的应用程序(用于登台)。如果我继续“创建新应用程序”,那么将在我的暂存帐户中创建该应用程序。

Is there some way to configure eb cli3 and get it to use different access keys?

有没有办法配置eb cli3并让它使用不同的访问密钥?

1 个解决方案

#1


47  

You can set up a new profile to use with the EB CLI. Profiles are shared between the AWS CLI and the EB CLI.

您可以设置新配置文件以与EB CLI一起使用。配置文件在AWS CLI和EB CLI之间共享。

Open up your aws config file: ~/.aws/config and add the following lines:

打开你的aws配置文件:〜/ .aws / config并添加以下行:

[profile profilename]
aws_access_key_id = aaaaaa
aws_secret_access_key = aaaaaaaaa123

Then you can call eb init --profile profilename. This will set up the EB CLI to use that specific profile for that specific directory.

然后你可以调用eb init --profile profilename。这将设置EB CLI以使用该特定目录的特定配置文件。


分享到: