Skip to content
This repository has been archived by the owner on Jun 28, 2019. It is now read-only.

Add support for ec2_filters #63

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

cheald
Copy link
Contributor

@cheald cheald commented Mar 15, 2016

@i've been finding myself needing ways to more specifically target classes of machines in my EC2 deploy, so I hacked this into my own copy of cap-ec2. The idea is that rather than specifying application and stage tags, you can provide your own list of filters. That is:

set :ec2_filters, { "tag:Project" => "*foo"*, "tag:Stages" => fetch(:stage) }

is functionally equivalent to the existing setup. However, I can also customize it with any filter supported by ec2-describe-instances.

set :ec2_filters, { "tag:Project" => "*foo"*, "tag:Stages" => fetch(:stage), "instance-type" => ["r3.xlarge" "r3.2xlarge"] }

Role filtering still applies with the previous strategy regardless (as Cap is pretty directly tied to the idea of roles).

I can compose an arbitrary set of filters to target specifically the machines I need to. It's been useful for me, and as a poweruser addition to the existing featureset, may find some use for other people too!

@korotovsky
Copy link

@andytinycat ping. This feature would be really helpful for me as well!

@AlexMorreale
Copy link

very cool Let's Get This Merged

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants