インストール
- jsonのmswin32ビルドをインスコ
- gem install aws-sdk
サンプルコード
#!/usr/bin/env ruby require 'rubygems' require 'aws' ec2 = AWS::EC2.new( :access_key_id => REPLACE_WITH_ACCESS_KEY_ID, :secret_access_key => REPLACE_WITH_SECRET_ACCESS_KEY, :ec2_endpoint => 'ec2.ap-northeast-1.amazonaws.com' ) ec2.instances.each do |i| p i.status end
~/work$ ./test.rb
:running
:stopped
:stopped
:running
:stopped