在AWS EBS中设置环境变量

时间:2016-01-05 19:58:40

标签: amazon-web-services

我想知道如何在Amazon的Elastic Beanstalk中设置环境变量?我以前只使用过GAE,可以在config.yaml文件中设置env变量。但我在EBS文档中没有找到类似的方法。非常感谢。

1 个答案:

答案 0 :(得分:0)

In your folder, create a file env.yaml

Inside the file env.yaml:

option_settings:
   aws:elasticbeanstalk:application:environment:
     Var1: xxxx
     Var2: yyyy

The variable names have to be less than 20 characters in length and cannot contain underscores. (I read it somewhere on stackexchange).

For variable names more than 20 characters and containing non-alphanumeric characters like "_", the only way I could get around this string requirement was to use the web interface.

Check that the environmental variables have been set by going to Configuration -> Software Configuration