Sumo: One-off EC2 Instance Launching

cloud ec2 chef sumo redis

Fri Aug 28 14:01:33 -0700 2009

One of the things I love about cloud computing is being able to quickly spin up instances for testing and experimentation. Lately I’ve started to become annoyed at the six or seven manual steps necessary to launch and connect to an instance on EC2 using the standard ec2-* command line tools. So I created a small tool to fire up a one-off instance, which I’m calling Sumo.


$ sumo launch
---> Launching instance...    i-4f809c26 (1.5s)
---> Acquiring hostname... (26.7s)

Logging you in via ssh.  Type 'exit' or Ctrl-D to return to your local system.
Linux domU-12-31-39-04-31-37 #1 SMP Fri Feb 15 12:39:36 EST 2008 i686

One command gets you a shell into a newly provisioned instance. Saves you the rigamarole of ec2-launch-instances / describe-instances / wait for hostname / cut-and-paste hostname / ssh command.

A bit more experimental, but Works On My Machine:

$ sumo launch redis
---> Launch instance...       i-b96c73d0 (1.3s)
---> Acquire hostname... (36.1s)
---> Wait for ssh...          done (9.0s)
---> Bootstrap chef...        done (61.3s)
---> Setup redis...           done (11.9s)
---> Opening firewall...      ports 6379 (5.2s)
Your instance is exporting the following resources:
  Redis: redis://

One command gets you a Redis endpoint that you can plug into export REDIS_URL= to run a blog on Redis. Not bad. (I’m a Chef newbie, so my Redis recipe probably sucks, but works for me.) Other recipes could be added, and then you can specify multiple roles on the same machine if you like:

$ sumo launch redis,couchdb
Your instance is exporting the following resources:
  Redis: redis://