Package: ebenv
ebenvAWS Elastic Beanstalk environment extractor/utilityThis is a command line utility to manage environment variables fromAWS Elastic Beanstalkapp
environments, to either re-use the same configuration locally or to import
into another environment.Currently two methods of extraction are supported, and one method to copy/sync
variables between environments:envenvdumps environment variables in a key=value format, example:$ ebenv env app-name app-env-name
AWS_ACCESS_KEY_ID=abcdefghijklmnopqrstvwuxyz
BUGSNAG_API_KEY=deadbeefdeadbeefdeadbeef
PARAM1=value
PARAM2=value
...

$ ebenv env app-name app-env-name > envfile
$ docker run --rm -it --env-file=envfile app/name
...envdirenvdirdumps environment variables into anenvdiras used by tools such as
djb'senvdir, runit'schpst, or one of the other clones,
example:$ ebenv envdir app-name app-env-name
found 4 vars, will write to '.env/*' [y/N]: n
Exiting..envdirwill prompt before writing any files or creating the directory, and
a--target_diroption can be specified:$ ebenv envdir app-name app-env-name --target_dir=.ebenv-copy
found 4 vars, will write to '.ebenv-copy/*' [y/N]: y
.ebenv-copy did not exists, creating

$ ls .ebenv-copy/
AWS_ACCESS_KEY_ID BUGSNAG_API_KEY   PARAM1            PARAM2A simplegrepcan verify that the env files contain the desired data:$ grep . .ebenv-copy/*
.ebenv-copy/AWS_ACCESS_KEY_ID:abcdefghijklmnopqrstvwuxyz
.ebenv-copy/BUGSNAG_API_KEY:deadbeefdeadbeefdeadbeef
.ebenv-copy/PARAM1:value
.ebenv-copy/PARAM2:valuecopycopycopies the environment variables from one environment within an EB app
to another environment in the same app.  Can optionally be used to remove vars
from the destination environment, that are not found in the source environment.$ ebenv copy app-name app-env-name new-app-env-name 
Source environment 'app-env-name'  has 22 options
Performing environment update...
Done, please check your EB web console to see the environment update progressRight nowcopywill overwrite any values in the destination environment for
keys found in the source environment.  If you specify the--removeoption,
it will remove any keys in the destination environment not found in the source
environment.$ ebenv copy app-name app-env-name new-app-env-name
Source environment 'app-env-name'  has 22 options
Will remove 2 options from destination environment 'new-app-env-name'
...This command is potentially very dangerous and destructive at this point,
especially if--removeis used.  Use with care.Setup$ make
virtualenv venv
New python executable in /Users/ses/w/ebenv/venv/bin/python2.7
Also creating executable in /Users/ses/w/ebenv/venv/bin/python
Installing setuptools, pip, wheel...done.
venv/bin/python setup.py develop
...Nowebenvis installed and available in the localvenv, and can be used
either by activating the virtualenv (source venv/bin/activate) or by running
it directly from the venv:venv/bin/ebenv.Dependenciesebenvdepends onboto3and relies on boto3 being able to find standard AWS
credentials either viaAWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYenv vars
in the local shell, or from~/.aws/(config|credentials).FutureWrite more options forcopy, it might be useful to prompt for every
detected change, to allow finer-grained copying of variables.  Maybe a--dryrunswitch to show the intended deltas.Other useful commands might include a way to set an environment based
on anenvfile or anenvdir, basically the opposite of those two
commands in the utility right now.