0

I have a Django app on Elastic Beanstalk with configuration files under .ebextensions that install packages via pip and set a series of environment variables. However, for my production deployment I will need to alter these environment variables (e.g. replace test API keys with production ones) is there a straightforward way to accomplish this functionality or maintain two different configurations for my development build and my production build?

Arham
  • 83
  • 2
  • 7
  • It would be simpler to use Environment Properties via the AWS console (or your preferred configuration management tool), but if that doesn't work for you, [have you tried this](https://stackoverflow.com/questions/42535753/aws-elastic-beanstalk-how-to-use-environment-variables-in-ebextensions)? (I'm not marking as duplicate because that question is over 5 years old, so I'm not sure if the answers still work). – Zac Anger Mar 05 '23 at 21:25
  • @ZacAnger Thank you I didn't find that post when I was researching earlier, I'll try to implement and see how it goes. – Arham Mar 06 '23 at 01:02
  • @ZacAnger This doesn't seem to work unfortunately, setting environment variables via a script simply does not allow them to show up for some reason in my elastic beanstalk virtual environment, I have tried to observe this by activating the staging virtual env and then using "env" every time I run eb deploy those variables get reset - if I remove them from my config then EB just removes them from the environment so manually setting these does not seem to be an option does it? – Arham Mar 07 '23 at 07:08

0 Answers0