Search code examples
djangoamazon-elastic-beanstalkamazon-linux-2

Where are my environment variables in Elastic Beanstalk for AL2?


I'm using elastic beanstalk to deploy a Django app. I'd like to SSH on the EC2 instance to execute some shell commands but the environment variables don't seem to be there. I specified them via the AWS GUI (configuration -> environment properties) and they seem to work during the boot-up of my app.

I tried activating and deactivating the virtual env via:

source /var/app/venv/*/bin/activate

Is there some environment (or script I can run) to access an environment with all the properties set? Otherwise, I'm hardly able to run any command like python3 manage.py ... since there is no settings module configured (I know how to specify it manually but my app needs around 7 variables to work).


Solution

  • Try running the command /opt/elasticbeanstalk/bin/get-config environment after you ssh into the EC2 instance.