如何为不同的弹性beanstalk环境添加不同的option_settings?

zlo*_*log 5 amazon-web-services amazon-elastic-beanstalk

我正在尝试为不同的弹性豆茎环境添加不同的环境NODE_ENV变量,即,option_settings.ebextensions

option_settings:
  - option_name: NODE_ENV
    value: production
Run Code Online (Sandbox Code Playgroud)

哪里valuestagingproduction取决于我拥有的2个不同的弹性beanstalk环境(它们也根据http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-branch-environment.html映射到不同的git分支)

可以在 中做到吗.ebextenions?或者我需要访问管理控制台吗?

fae*_*anj -1

是的,如果每个环境有不同的包,则可以在 .ebextensions 中执行此操作。对于单个包,您必须在运行时使用管理控制台、CLI 或 SDK 进行设置。

  • 如果您使用 eb 客户端,您还可以尝试使用 `ebbranch`,它允许您在不同的 git 分支中维护不同的值:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-reference-branch -环境.html (2认同)