Created
February 21, 2012 06:01
-
-
Save viviandarkbloom/1874110 to your computer and use it in GitHub Desktop.
Get data about AWS instances
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
require 'rubygems' | |
require 'yaml' | |
require 'right_aws' | |
connect = File.open('./cred.yml') | |
creds = YAML.load(connect) | |
aws_access_key_id = creds["Credentials"]["aws_access_key_id"] | |
aws_secret_access_key = creds["Credentials"]["aws_secret_access_key"] | |
@ec2 = RightAws::Ec2.new(aws_access_key_id, aws_secret_access_key) | |
servers = @ec2.describe_instances.to_yaml | |
File.open('./servers.yml','w') do |file| | |
file.write (servers) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment