Awsymandias is a library that helps you set up and tear down complicated AWS environments. In addition to offering a clean, literate domain model for working with instances it allows you to persist role-to-instance-id mappings to SimpleDB, allowing you to manage your full stack from multiple different machines. Here's an example:
# Give the stack a name, and describe its members. stack = Awsymandias::EC2::ApplicationStack.new("test") do |s| s.role "db", :instance_id => "ami-dc789fb5", :key_name => "gsg-keypair", :instance_type => "m1.large", :availability_zone => "us-east-1c" s.role "app", :instance_id => "ami-dc789fb5", :key_name => "gsg-keypair", :instance_type => "c1.xlarge", :availability_zone => "us-east-1c" end # Check if we're running by pulling stack description from SDB; if not, launch asynchronously. stack.launch unless stack.running? until stack.running? sleep(5) end # Capistrano task :test do set :db, stack.db.public_dns set :app, stack.app.public_dns end
The example given above should allow you to re-launch and deploy that AWS stack from any one of several different workstations.
(The MIT License)
Copyright © 2009 Brian Guthrie (email@example.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.