Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Elastic Beanstalk: Application directory/script location on the EC2 Server

I have a flask application on AWS. I need to access a python script inside the App directory at runtime (to run a daily cron job). I've SSH access to the EC2 server, but I can't locate the directory in which AWS has uploaded my code. Any idea where AWS puts the code?

like image 763
Nitin Nain Avatar asked Apr 07 '14 14:04

Nitin Nain


1 Answers

Elastic beanstalk organizes python code under: /opt/python/

Specifically your current app is available under /opt/python/current/app (/opt/python/current is a link to /opt/python/bundle/${bundle_version}/)

Remember that Beanstalk makes use of virtualenv and its location is: /opt/python/run/venv

If you want to use a python shell with all the environment variable you are expecting you have to:

source /opt/python/run/venv/bin/activate

then:

source /opt/python/current/env

(with the first command you activate the virtual environment with the seconds you load up all the environment variables you did define via eb settings)

like image 149
daveoncode Avatar answered Oct 06 '22 01:10

daveoncode