2016-09-23 04:21:00 +03:00
Deployment with Elastic Beanstalk
==========================================
.. index :: Elastic Beanstalk
Warning: Experimental
---------------------
This is experimental. For the time being there will be bugs and issues. If you've never used Elastic Beanstalk before, please hold off before trying this option.
On the other hand, we need help cleaning this up. If you do have knowledge of Elastic Beanstalk, we would appreciate the help. :)
Prerequisites
-------------
* awsebcli
Instructions
-------------
2016-09-24 03:14:17 +03:00
If you haven't done so, create a directory of environments.
2016-09-23 07:45:16 +03:00
::
2016-09-23 04:21:00 +03:00
2016-09-23 07:45:16 +03:00
eb init -p python3.4 {{ cookiecutter.project_slug }}
2016-09-23 04:21:00 +03:00
2016-09-24 03:14:17 +03:00
Once that is done, create the environment (server) where the app will run
::
2016-09-23 07:45:16 +03:00
eb create {{ cookiecutter.project_slug }}
2016-09-24 03:14:17 +03:00
# Note: This will eventually fail on a postgres error, because postgres doesn't exist yet
Now make sure you are in the right environment
::
2016-09-23 04:21:00 +03:00
2016-09-23 07:45:16 +03:00
eb list
2016-09-23 04:21:00 +03:00
2016-09-24 03:14:17 +03:00
TODO: Finsh it::
2016-09-23 07:45:16 +03:00
# If you are not in the right environment
eb use {{ cookiecutter.project_slug }}
2016-09-23 04:21:00 +03:00
2016-09-23 07:45:16 +03:00
# Set the environment variables
python ebsetenv.py
2016-09-23 04:21:00 +03:00
2016-09-23 07:45:16 +03:00
# Go to EB AWS config. Create new RDS database (postgres, 9.4.9, db.t2.micro)
# Get some coffee, this is going to take a while
2016-09-23 04:21:00 +03:00
2016-09-23 07:45:16 +03:00
# Deploy again
eb deploy
# Take a look
eb open
2016-09-23 04:21:00 +03:00
FAQ
-----
Why Not Use Docker on Elastic Beanstalk?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2016-09-23 07:45:16 +03:00
Because I didn't want to add an abstraction (Docker) on top of an abstraction (Elastic Beanstalk) on top of an abstraction (Cookiecutter Django).
2016-09-26 20:23:45 +03:00
Why Can't I Use Both Docker/Heroku with Elastic Beanstalk?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Because the environment variables that our Docker and Heroku setups use for PostgreSQL access is different then how Amazon RDS handles this access. At this time we're just trying to get things to work reliably with Elastic Beanstalk, and full integration will come later.