Sha256: 9860176d807bc78f13c164a4006a75235ffcf664a9a4e9cd3ba43cceb719caad
Contents?: true
Size: 652 Bytes
Versions: 1
Compression:
Stored size: 652 Bytes
Contents
$:.unshift File.dirname(__FILE__) require 'right_aws' require 'yaml' class Ec2Name def run @name = ARGV[0] if @name.nil? fail("ERROR: Need to supply a name. Usage: #{__FILE__} [name]") end @config = YAML.load(IO.read("#{ENV['HOME']}/.br-cloud.yml")) @ec2 = RightAws::Ec2.new(@config[:aws_secret_id], @config[:aws_secret_key]) instance_id = ENV['INSTANCE_ID'] || `curl -s http://169.254.169.254/latest/meta-data/instance-id` puts "Creating tag Name #{@name} for instance #{instance_id}" @ec2.create_tags(instance_id, 'Name' => @name) puts "Created tag Name #{@name} for instance #{instance_id}" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ec2_name-0.1.0 | lib/ec2_name.rb |