Created
June 13, 2012 17:51
-
-
Save mattfinlayson/2925484 to your computer and use it in GitHub Desktop.
right_aws example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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