2

I wonder how I can set the environment variables in Amazon's Elastic Beanstalk? I've only worked with GAE before, in which the env vars can be set in the config.yaml file. But I didn't find a similar way in EBS documentation. Thanks a lot.

J Freebird
  • 3,664
  • 7
  • 46
  • 81
  • 1
    Have you tried any of the options in [How do you pass custom environment variable on Amazon Elastic Beanstalk (AWS EBS)?](http://stackoverflow.com/questions/11211007/how-do-you-pass-custom-environment-variable-on-amazon-elastic-beanstalk-aws-ebs)? – James Jan 05 '16 at 20:03
  • @James Yes, it should work. I didn't find that in the console... Thanks a lot! – J Freebird Jan 05 '16 at 20:19
  • Here's the answer: http://stackoverflow.com/questions/11211007/how-do-you-pass-custom-environment-variable-on-amazon-elastic-beanstalk-aws-ebs – J Freebird Jan 06 '16 at 01:07

1 Answers1

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

manymoons
  • 25
  • 5