Class: Tagenv::Ec2::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/tagenv/ec2/tag.rb

Instance Method Summary collapse

Constructor Details

#initialize(prefix: '', instance_id: nil) ⇒ Tag

Returns a new instance of Tag.



7
8
9
10
11
12
13
# File 'lib/tagenv/ec2/tag.rb', line 7

def initialize(prefix: '', instance_id: nil)
  @logger = Logger.new(STDOUT)
  region = ENV['AWS_REGION'] || Metadata.get_document['region']
  @ec2 = Aws::EC2::Client.new(region: region)
  @prefix = prefix
  @instance_id = instance_id
end

Instance Method Details

#get_tag_hashObject



15
16
17
# File 'lib/tagenv/ec2/tag.rb', line 15

def get_tag_hash
  instances_tag_with_id
end