从弹性魔豆.ebextensions配置文件中引用的env变量变量、配置文件、弹性、魔豆

2023-09-11 10:16:52 作者:七月逆流

难道posssible引用PARAM1 /参数2等。从.ebextensions容器环境属性配置文件。如果是这样,怎么样?我试过$ PARAM1但它似乎是一个空值。

我要设置在启动时的主机名包含DEV,QA和PROD,这是我通过PARAM1环境变量传递给我的容器。

 命令:
  01,设置正确的主机名:
    命令:主机名myappname {$ PARAM1} .COM
 

解决方案

原来,你只能做到这一点,在 container_commands 部分,而不是命令部分。

本作品:

  container_commands:
  01,设置正确的主机名:
    命令:主机名myappname {$ PARAM1} .COM
 
HttpRunner 安装使用

请参阅http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands了解更多详情。

Is it posssible to reference the PARAM1 / PARAM2 etc.. container environment properties from the .ebextensions config files. If so, how? I tried $PARAM1 but it seemed to be an empty value.

I want to set the hostname on startup to contain DEV, QA or PROD, which I pass to my container via the PARAM1 environment variable.

commands:
  01-set-correct-hostname:
    command: hostname myappname{$PARAM1}.com

解决方案

It turns out you can only do this in the container_commands section, not the commands section.

This works:

container_commands:
  01-set-correct-hostname:
    command: "hostname myappname{$PARAM1}.com"

See http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands for more details.