从弹性魔豆.ebextensions配置文件中引用的env变量 [英] Referencing env variables from Elastic Beanstalk .ebextensions config files

查看:211
本文介绍了从弹性魔豆.ebextensions配置文件中引用的env变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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

解决方案

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

本作品:

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

请参阅<一href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#customize-containers-format-container_commands" rel="nofollow">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.

这篇关于从弹性魔豆.ebextensions配置文件中引用的env变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆