Skip to content
This repository
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 30 lines (24 sloc) 0.79 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/usr/bin/env ruby

# Amazon Web Services EC2 Query API Ruby library
#
# Ruby Gem Name:: amazon-ec2
# Author:: Glenn Rempe (mailto:glenn@rempe.us)
# Copyright:: Copyright (c) 2007-2008 Glenn Rempe
# License:: Distributes under the same terms as Ruby
# Home:: http://github.com/grempe/amazon-ec2/tree/master
#++

if ENV['AMAZON_ACCESS_KEY_ID'] && ENV['AMAZON_SECRET_ACCESS_KEY']
  opts = {
    :access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
    :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY']
  }
  if ENV['EC2_URL']
    opts[:server] = URI.parse(ENV['EC2_URL']).host
  end
  @ec2 = AWS::EC2::Base.new(opts)
  @elb = AWS::ELB::Base.new(opts)
  @as = AWS::Autoscaling::Base.new(opts)
  @rds = AWS::RDS::Base.new(opts)
end

puts "EC2 Server: #{opts[:server]}"

include AWS

Something went wrong with that request. Please try again.