Class: Stackster::InstanceReader

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

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ InstanceReader

Returns a new instance of InstanceReader.



4
5
6
# File 'lib/stackster/instance/instance_reader.rb', line 4

def initialize(args)
  @config = args[:config]
end

Instance Method Details

#list_stack_instances(stack_name) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/stackster/instance/instance_reader.rb', line 8

def list_stack_instances(stack_name)
  @asg_id = auto_scaling_group_id(stack_name)

  return [] unless @asg_id

  asg_instances = auto_scaling.list_instances

  return [] unless asg_instances.any?

  ec2.describe_instance asg_instances
end