Class: Stackster::InstanceReader
- Inherits:
-
Object
- Object
- Stackster::InstanceReader
- Defined in:
- lib/stackster/instance/instance_reader.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ InstanceReader
constructor
A new instance of InstanceReader.
- #list_stack_instances(stack_name) ⇒ Object
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 19 20 |
# File 'lib/stackster/instance/instance_reader.rb', line 8 def list_stack_instances(stack_name) h = [] describe_instances.each do |instance| tag_set = instance['instancesSet'].first['tagSet'] instance_stack_name = tag_set['aws:cloudformation:stack-name'] if instance_stack_name && instance_stack_name == stack_name if instance_running? instance h << instance end end end h end |