Class: AWS::EC2

Inherits:
Object
  • Object
show all
Defined in:
lib/kelbim/ext/ec2-ext.rb

Instance Method Summary collapse

Instance Method Details

#instance_namesObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/kelbim/ext/ec2-ext.rb', line 5

def instance_names
  vpc_instance_id_names = {}

  self.instances.each do |i|
    vpc_instance_id_names[i.vpc_id] ||= {}
    vpc_instance_id_names[i.vpc_id][i.id] = i.tags['Name']
  end

  return vpc_instance_id_names
end

#security_group_namesObject



16
17
18
19
20
21
22
23
24
25
# File 'lib/kelbim/ext/ec2-ext.rb', line 16

def security_group_names
  vpc_sg_id_names = {}

  self.security_groups.each do |i|
    vpc_sg_id_names[i.vpc_id] ||= {}
    vpc_sg_id_names[i.vpc_id][i.id] = i.name
  end

  return vpc_sg_id_names
end