Class: SimpleDeploy::StackReader

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_deploy/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/simple_deploy/stack/stack_reader.rb', line 4

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

Instance Method Details

#attributes ⇒ Object



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

def attributes
  entry.attributes
end

#events(limit) ⇒ Object



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

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

#instances ⇒ Object



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

def instances
  instance_reader.list_stack_instances @name
end

#outputs ⇒ Object



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

def outputs
  cloud_formation.stack_outputs @name
end

#parameters ⇒ Object



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

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

#resources ⇒ Object



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

def resources
  cloud_formation.stack_resources @name
end

#status ⇒ Object



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

def status
  cloud_formation.stack_status @name
end

#template ⇒ Object



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

def template
  cloud_formation.template @name
end