mheffner / awsam

Amazon Web Services Account Manager (modeled after 'rvm')
MIT License
117 stars 8 forks source link

Feature/ssh using ec2 tag #8

Closed johnclaus closed 10 years ago

johnclaus commented 10 years ago

Added the ability to allow assh to connect to an EC2 node using a tag name.

mheffner commented 10 years ago

Cool, I'll give this a shot. Thanks for putting this together.

johnclaus commented 10 years ago

:thumbsup: Sure thing.

mheffner commented 10 years ago

Hrm, I think this needs to de-dup the returned instances:

$ assh kafka
Please select which node you wish to use:
0) kafkanode-1
1) kafkanode-1

Probably because we have a bunch of similar tags set:

$ ec2dtag | grep kafka
TAG instance    i-1234  Name    kafkanode-1
TAG instance    i-1234  LIBRATO_SOURCE  kafkanode-1
TAG instance    i-1234  kafkanode-1 
johnclaus commented 10 years ago

I just pushed a commit which only lists nodes with a resource_type of "instance". This should solve your original problem with duplicate tags.

mheffner commented 10 years ago

@johnclaus The tags above are all instance tags though, so this doesn't reduce the dups. I think the code actually has to uniq the returned set of instances based on their instance ids. Give this a try on our dev account with assh kafka, I would expect only one entry.

johnclaus commented 10 years ago

:thumbsup:

mheffner commented 10 years ago

Looks good!