Class: Stackster::StackReader

Inherits:
Object
  • Object
show all
Defined in:
lib/stackster/stack/stack_reader.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ StackReader

Returns a new instance of StackReader.



4
5
6
7
# File 'lib/stackster/stack/stack_reader.rb', line 4

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

Instance Method Details

#attributesObject



9
10
11
# File 'lib/stackster/stack/stack_reader.rb', line 9

def attributes
  entry.attributes
end

#events(limit) ⇒ Object



21
22
23
# File 'lib/stackster/stack/stack_reader.rb', line 21

def events(limit)
  cloud_formation.stack_events @name, limit
end

#instancesObject



38
39
40
# File 'lib/stackster/stack/stack_reader.rb', line 38

def instances
  instance_reader.list_stack_instances @name
end

#outputsObject



13
14
15
# File 'lib/stackster/stack/stack_reader.rb', line 13

def outputs
  cloud_formation.stack_outputs @name
end

#parametersObject



33
34
35
36
# File 'lib/stackster/stack/stack_reader.rb', line 33

def parameters
  json = JSON.parse template
  json['Parameters'].nil? ? [] : json['Parameters'].keys
end

#resourcesObject



25
26
27
# File 'lib/stackster/stack/stack_reader.rb', line 25

def resources
  cloud_formation.stack_resources @name
end

#statusObject



17
18
19
# File 'lib/stackster/stack/stack_reader.rb', line 17

def status
  cloud_formation.stack_status @name
end

#templateObject



29
30
31
# File 'lib/stackster/stack/stack_reader.rb', line 29

def template
  cloud_formation.template @name
end