Class: Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/eops/instance.rb

Instance Method Summary collapse

Constructor Details

#initializeInstance

Returns a new instance of Instance.



2
3
4
5
# File 'lib/eops/instance.rb', line 2

def initialize
  @ec2 = AWS::EC2.new
  @auto_scaling= AWS::AutoScaling.new
end

Instance Method Details

#destroyObject



7
8
# File 'lib/eops/instance.rb', line 7

def destroy
end

#find_in_as_group(as_group_name) ⇒ Object



10
11
12
13
14
# File 'lib/eops/instance.rb', line 10

def find_in_as_group(as_group_name)
  first_instance = @auto_scaling.groups[as_group_name].auto_scaling_instances.first.id

  return @ec2.instances[first_instance].ip_address
end

#find_sg_name(sg_id) ⇒ Object



16
17
18
# File 'lib/eops/instance.rb', line 16

def find_sg_name(sg_id)
  @ec2.security_groups[sgid].name
end