Class: Stacker::Region
- Inherits:
-
Object
- Object
- Stacker::Region
- Defined in:
- lib/stacker/region.rb
Instance Attribute Summary collapse
-
#defaults ⇒ Object
readonly
Returns the value of attribute defaults.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stacks ⇒ Object
readonly
Returns the value of attribute stacks.
-
#templates_path ⇒ Object
readonly
Returns the value of attribute templates_path.
Instance Method Summary collapse
- #client ⇒ Object
-
#initialize(name, defaults, stacks, templates_path) ⇒ Region
constructor
A new instance of Region.
- #stack(name) ⇒ Object
Constructor Details
#initialize(name, defaults, stacks, templates_path) ⇒ Region
Returns a new instance of Region.
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/stacker/region.rb', line 9 def initialize(name, defaults, stacks, templates_path) @name = name @defaults = defaults @stacks = stacks.map do || begin Stack.new self, .fetch('name'), rescue KeyError => err Stacker.logger.fatal "Malformed YAML: #{err.message}" exit 1 end end @templates_path = templates_path end |
Instance Attribute Details
#defaults ⇒ Object (readonly)
Returns the value of attribute defaults.
7 8 9 |
# File 'lib/stacker/region.rb', line 7 def defaults @defaults end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/stacker/region.rb', line 7 def name @name end |
#stacks ⇒ Object (readonly)
Returns the value of attribute stacks.
7 8 9 |
# File 'lib/stacker/region.rb', line 7 def stacks @stacks end |
#templates_path ⇒ Object (readonly)
Returns the value of attribute templates_path.
7 8 9 |
# File 'lib/stacker/region.rb', line 7 def templates_path @templates_path end |
Instance Method Details
#client ⇒ Object
23 24 25 |
# File 'lib/stacker/region.rb', line 23 def client @client ||= AWS::CloudFormation.new region: name end |
#stack(name) ⇒ Object
27 28 29 |
# File 'lib/stacker/region.rb', line 27 def stack name stacks.find { |s| s.name == name } || Stack.new(self, name) end |