Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Categorising EC2 instances

Is there a way to distinguish between sets of EC2 instances?

My use case is that I have a bunch of web tier machines and a bunch of search tier machines; currently the only way to track what each instance is doing is in a roll-your-own asset directory, like LDAP or a database.

Ideally, I'd like to be able to determine the role of a machine from the metadata available from the AWS APIs.

Currently, the only approach I've come up with is to have different machine roles in different security groups (even if it's not strictly required). Is there a better way?

like image 988
James Brady Avatar asked Nov 28 '25 22:11

James Brady


2 Answers

Update: EC2 now supports "tags" for categorising instances.

http://docs.amazonwebservices.com/AWSEC2/latest/UserGuide/index.html?Using_Tags.html


I've always used security groups for categorising. I don't see anything wrong with using them!

Groups not only allow categorising, they also allow different firewall rules. You can also have more than one group per instance, e.g. "production", "database"

Reference: http://docs.amazonwebservices.com/AWSEC2/2008-12-01/DeveloperGuide/index.html?ApiReference-SOAP-RunInstances.html

like image 175
gak Avatar answered Dec 01 '25 09:12

gak


You might want to check out some third party tools like rightscale which adds some capability for managing cloud resources with additional metadata like meaningful labels on volumes and instances. I am only using the free version right now which is somewhat limited, but it still adds quite a bit over the Amazon provided management tools.

Amazon just announced their own console (https://console.aws.amazon.com/), which initially got me excited about the prospect of a free version of RightScale. However, it looks like it is just a Web UI that is functionally equivalent to ElasticFox. Oh well.

I am still keeping a spreadsheet locally to keep track of this mess. Also, this is extremely low tech, but I am dropping a text file on the desktop of each machine (under the admin account) with the purpose of the machine in the filename so I can tell them apart (the generated machine names are absolutely no help without a cheat sheet.)

like image 20
JohnFx Avatar answered Dec 01 '25 09:12

JohnFx