Class: Bora::Template
- Inherits:
-
Object
- Object
- Bora::Template
- Defined in:
- lib/bora/template.rb
Constant Summary collapse
- INHERITABLE_PROPERTIES =
These are properties that you can define on the template, but which can also be defined and overriden in the stack
%w[capabilities default_region tags on_failure disable_rollback].freeze
- OVERRIDABLE_PROPERTIES =
These are properties that can be passed in from the command line to override what’s defined inthe stack
%w[cfn_stack_name].freeze
Instance Method Summary collapse
-
#initialize(template_name, template_config, override_config = {}) ⇒ Template
constructor
A new instance of Template.
- #rake_tasks ⇒ Object
- #stack(name) ⇒ Object
- #stacks ⇒ Object
Constructor Details
#initialize(template_name, template_config, override_config = {}) ⇒ Template
Returns a new instance of Template.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/bora/template.rb', line 12 def initialize(template_name, template_config, override_config = {}) @template_name = template_name @template_config = template_config @stacks = {} template_config['stacks'].each do |stack_name, stack_config| stack_name = "#{template_name}-#{stack_name}" resolved_config = resolve_stack_config(template_config, stack_config, override_config) @stacks[stack_name] = Stack.new(stack_name, template_config['template_file'], resolved_config) end end |
Instance Method Details
#rake_tasks ⇒ Object
31 32 33 |
# File 'lib/bora/template.rb', line 31 def rake_tasks @stacks.each { |_, s| s.rake_tasks } end |
#stack(name) ⇒ Object
23 24 25 |
# File 'lib/bora/template.rb', line 23 def stack(name) @stacks[name] end |
#stacks ⇒ Object
27 28 29 |
# File 'lib/bora/template.rb', line 27 def stacks @stacks.values end |