Class: Bora::Template

Inherits:
Object
  • Object
show all
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

Constructor Details

#initialize(template_name, template_config, override_config = {}) ⇒ Template

Returns a new instance of Template.



13
14
15
16
17
18
19
20
21
22
# File 'lib/bora/template.rb', line 13

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_tasksObject



32
33
34
# File 'lib/bora/template.rb', line 32

def rake_tasks
  @stacks.each { |_, s| s.rake_tasks }
end

#stack(name) ⇒ Object



24
25
26
# File 'lib/bora/template.rb', line 24

def stack(name)
  @stacks[name]
end

#stacksObject



28
29
30
# File 'lib/bora/template.rb', line 28

def stacks
  @stacks.values
end