如何在没有手动说明的情况下使用 eb init

Den*_*boy 11 amazon-web-services amazon-elastic-beanstalk ebcli

我想eb deploy在一个干净的环境中制作一个。它告诉我我首先需要执行eb init.

当我这样做时,我看到以下内容:

Select a default region
1) us-east-1 : US East (N. Virginia)
2) us-west-1 : US West (N. California)
3) us-west-2 : US West (Oregon)
4) eu-west-1 : EU (Ireland)
5) eu-central-1 : EU (Frankfurt)
6) ap-south-1 : Asia Pacific (Mumbai)
7) ap-southeast-1 : Asia Pacific (Singapore)
8) ap-southeast-2 : Asia Pacific (Sydney)
9) ap-northeast-1 : Asia Pacific (Tokyo)
10) ap-northeast-2 : Asia Pacific (Seoul)
11) sa-east-1 : South America (Sao Paulo)
12) cn-north-1 : China (Beijing)
13) us-east-2 : US East (Ohio)
14) ca-central-1 : Canada (Central)
15) eu-west-2 : EU (London)
(default is 3):
Run Code Online (Sandbox Code Playgroud)

如您所见,设置需要手动说明。如何自动执行此设置?

我试过

$ export AWS_ACCESS_KEY_ID="xxx"
$ export AWS_SECRET_ACCESS_KEY="xxx"
$ export AWS_DEFAULT_REGION="xxx"
$ eb init
Run Code Online (Sandbox Code Playgroud)

但是再次有必要选择地区等(如上)?

如何.aws在没有手动交互的情况下自动生成eb 部署,只有命令?

编辑 我试过:

init --region eu-west-1 应用名

这已经让我更进一步了,但现在我收到了:

Select the default environment.

You can change this later by typing "eb use [environment_name]".
1) app-dev
2) app-uat
Run Code Online (Sandbox Code Playgroud)

如何在我的eb init命令中自动执行此设置?

pro*_*fan 10

  1. 我想eb deploy在一个干净的环境中制作一个。它告诉我我首先需要执行 eb init。

Looks like you've solved this problem, but I'll clarify anyway: The EBCLI requires that the present working directory be rooted at an eb init-ed application. The EBCLI looks for a .elasticbeanstalk/config.yml directory to determine whether the PWD has been eb init-ed. Almost all eb operations require the PWD to have been init-ed with a Beanstalk application.

  1. EDIT I tried: eb init --region eu-west-1 appname ...

You're almost there. In order to suppress the interactive mode, which is what you are trying to do, you need to pass the --platform flag. I can clearly see how inconvenient this is, but what you need is:

eb init --region eu-west-1 --platform <platform-name> appname

Where <platform-name> is the name of the language your app is in. Passing the --platform argument suppresses the interactive mode according to the documentation.

Once that is done, you can execute:

  • eb use <environment name> followed by eb deploy, or just

  • eb deploy <environment-name>

  • 我也不能让它工作。文档很差。我尝试了 eb init pathfinder --platform arn:aws:elasticbeanstalk:eu-west-2::platform/Puma 和运行在 64 位 Amazon Linux/2.9.0 上的 Ruby 2.6 | 并得到错误 | eb:错误:无法识别的参数:在 64 位 Amazon Linux/2.9.0 上运行 Ruby 2.6 | (2认同)
  • 尝试在引号和引号外,每一种方式。没有喜悦。我暂时放弃了 Elastic Beanstalk,文档太糟糕了。 (2认同)