Skip to content

Instantly share code, notes, and snippets.

@mattfinlayson
Created June 13, 2012 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattfinlayson/2925484 to your computer and use it in GitHub Desktop.
Save mattfinlayson/2925484 to your computer and use it in GitHub Desktop.
right_aws example
#!/usr/bin/env ruby
require 'rubygems'
require 'right_aws'
require 'base64'
AMAZON_PUBLIC_KEY='XXX'
AMAZON_PRIVATE_KEY='XXX'
ec2 = RightAws::Ec2.new(AMAZON_PUBLIC_KEY, AMAZON_PRIVATE_KEY)
autoproxy_options = {
:image_id => 'ami-a6f504cf',
:key_name => 'gsg-keypair',
:availability_zone => 'us-east-1b'
}
puts "- launching image"
#response = ec2.run_instances(autoproxy_options)
#puts response.to_s
# This is getting, and decodding the console
#console_output = ec2.get_console_output(:instance_id => 'i-b8cd77d7')
#puts Base64.decode64(console_output["output"])
description = ec2.describe_instances(['i-b8cd77d7'])
description.each do |item|
puts item[:aws_state]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment