airbnb/synapse — pull request #66 by bazbremner (2014-05-06 17:22:08+00:00)
Title: Implement ec2 tag watcher

Hello, I've implemented the EC2Watcher, which was just a stub, plus a few specs.

Things to note:

* Right now only one tag/value is checked for - it is possible to chain additional filters in the aws-sdk gem when querying the AWS API, but I'm keeping it simple for now
* Instances private IP and hostname are used for `host` and `name` respectively when generating the backends. This might not suit everyone and could be extended to be more flexible, but again I'm keeping it simple and it suits my use case.

Some specs and logic lifted from @bobtfish's docker watcher, so there may be some scope for shared logic in future.
I'm not entirely sure I've got the handling and access of `haproxy['server_port_override']` correctly, so comments on that in particular would be good - it works, it just looks a little crufty.

Comments welcome.