ThoughtWorksStudios / eb_deployer

AWS Elastic Beanstalk blue-green deployment automation from ThoughtWorks Mingle Team
MIT License
400 stars 94 forks source link

Tutorial regarding RDS (and other environmental variables?) #19

Closed jufemaiz closed 10 years ago

jufemaiz commented 10 years ago

how to setup RDS or other AWS resource and share them between blue green environments

Interested in hearing about this and other comments on how to deal with environmental variables. Nothing yet looked terribly easy.

xli commented 10 years ago

What's language are you looking for? I'm working on Rails plugin and creating tutorial / introduction of setting RDS up with blue green environments for Ruby Elastic Beanstalk solution stack.

jufemaiz commented 10 years ago

Rails.

The biggest thing I've found reading through documentation all over the place is best practices for automating the access to credentials (Databases, API Keys etc). The Environmental Variables available in the console are great, but limited in number, which when you're using an existing RDS becomes problematic. Ditto if you want to migrate to new keys etc.

It's definitely not EB specific issue, so I'm curious how others have solved them. Are they using Chef/Puppet or another approach?

xli commented 10 years ago

We put almost everything configurable in environment variables. API keys, database username and password, etc.. For migration, we keep 2 keys for a while until old one is not used anymore.

xli commented 10 years ago

Hi @jufemaiz ,

I'm not sure what's exactly you're looking for, recently we've put in a Rails 3+ support, and here is document: https://github.com/ThoughtWorksStudios/eb_deployer/wiki/Rails-3-Support

The default Rails support will generate a RDS cloud formation as "resources" in your eb_deploy.yml file, and pass the RDS HOST and other configurations to EB environments.

The "resources" section in eb_deploy.yml file defines resources shared between blue-green environments by CloudFormation.

However, there maybe still have some resources you don't want to put into eb_deploy.yml config file, I recommend carefully constructing environment variables to connect to these resources.

jufemaiz commented 10 years ago

@xli thanks for that. Sorry for the delayed reply. That's precisely the sort of information I was looking for. Would also love to see a how-to extend to if there could be support for cloudformation templates that refer to other templates :)

xli commented 10 years ago

What you mean "other templates"?