I am using github (public) to keep track of my web app and about to deploy it to Elastic Beanstalk. Is there a good way to keep my config file secure which has RDS username/password? I have to add the file to git in order to push it to Elastic Beanstalk but this will make my password visible to everyone on github...? Any suggestions? Thanks!
Asked
Active
Viewed 692 times
2
-
Store them in the environment variables; don't hard code them in the repo. Not familiar with Elastic Beanstalk in particular, but such platforms usually provides some configuration interface for them, such as [this](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_Java.managing.html). – Rufflewind Jun 20 '15 at 03:20
-
@ Rufflewind Thank you! – E.K. Jun 20 '15 at 04:11
1 Answers
3
Your intuition is correct! Definitely keep your keys/passwords/credentials out of your committed codebase.
Elastic Beanstalk provides environment variables in the control panel for just this purpose. The official documentation can be found here: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-ruby
These environment variables can be edited through the Elastic Beanstalk UI.
You can then reference these variables in your .yml
config files, e.g. password: <%= ENV['PARAM1'] %>
.

rossettistone
- 364
- 2
- 11
-
Got it. it seems like I need to read through these two official docs for my python app. [Python Container Options](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html#command-options-python) and [Using an Existing Amazon RDS DB Instance with Python](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create-deploy-python-rds.html). Thank you so much! – E.K. Jun 20 '15 at 04:14
-
@user3128336 you can also set env vars using the CLI `eb setenv` or during create time `eb create --envvars` – Nick Humrich Jun 20 '15 at 16:05
-
-
With your advice, I was able to do this by adding env variables on eb and accessing them like os.environ['DB_PASSWORD']. Thanks a lot guys! – E.K. Jun 23 '15 at 02:31