As I've been using Elastic Beanstalk more and more, I've been finding the need
to alter my
.ebextensions
files per-environment. I may be using different credentials files in dev and
QA, using different sets of AWS credentials (and S3 buckets), or just trying
to get my environment name into a script. Initially, I had Jenkins running
sed commands before deploying to each environment, but eventually I realized
that my Django settings files could be the source of truth for each
environment. I ended up creating
django-makeconf
to build other configuration files that I needed.
The project is really simple -- You just pip install django-makeconf and add
'makeconf' to your INSTALLED_APPS list in your settings. This enables the
manage.py makeconf command, which builds a set of configuration files based
on information in your Django settings module. Simple make sure
DJANGO_SETTINGS_MODULE is set to the configuration you want to use (or use
manage.py's --settings= flag).
I've got a private repo of some shared .ebextensions files I use regularly,
but I'm also planning on including some more general features, like
running Celery in Elastic Beanstalk.
Rather than repeat the docs
here, I'll go ahead and leave this as an announcement, and possibly publish
some examples in another post.