Created
May 16, 2013 03:27
-
-
Save popowa/5589167 to your computer and use it in GitHub Desktop.
インスタンス一覧とTagからNameな物を出力するだけ
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 'aws-sdk' | |
AWS.config({ | |
:access_key_id => 'XXXXXXXXXXXXXXXXXXXXXXX', | |
:secret_access_key => 'XXXXXXXXXXXXXXXXXXXXXXX', | |
:ec2_endpoint => 'ec2.ap-northeast-1.amazonaws.com' | |
}) | |
ec2 = AWS::EC2.new | |
ec2.instances.each { |instance| | |
puts "#{instance.id}, #{instance.image_id}, #{instance.status}, #{instance.tags["Name"]}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment