Skip to content

Instantly share code, notes, and snippets.

@yoppi
Created September 18, 2012 07:35
Show Gist options
  • Save yoppi/3741805 to your computer and use it in GitHub Desktop.
Save yoppi/3741805 to your computer and use it in GitHub Desktop.
起動してるアプリのdns名取得
require 'aws-sdk'
require 'yaml'
tag_name = ARGV.shift
tag_values = ARGV
AWS.config(YAML.load_file('config.yml'))
p AWS::EC2.new.instances.tagged(tag_name).tagged_values(tag_values).map {|instance|
instance.public_dns_name
}.join(" ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment