Class: CfnBackup::CfHighlander

Inherits:
Object
  • Object
show all
Defined in:
lib/cfnbackup/cfhighlander.rb

Instance Method Summary collapse

Constructor Details

#initialize(region, name, config, output_dir) ⇒ CfHighlander

Returns a new instance of CfHighlander.



10
11
12
13
14
15
16
17
# File 'lib/cfnbackup/cfhighlander.rb', line 10

def initialize(region, name, config, output_dir)
  @component_name = name
  @region = region
  @config = config
  @cfn_output_format = 'yaml'
  @output_dir = output_dir
  ENV['CFHIGHLANDER_WORKDIR'] = output_dir
end

Instance Method Details

#publish(cf_compiler) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/cfnbackup/cfhighlander.rb', line 28

def publish(cf_compiler)
  publisher = Cfhighlander::Publisher::ComponentPublisher.new(cf_compiler.component, false, @cfn_output_format)
  Log.logger.debug("Publishing compiled templates to S3")
  publisher.publishFiles(cf_compiler.cfn_template_paths)
  Log.logger.debug("Master template URL: #{publisher.getTemplateUrl}")
  return publisher.getTemplateUrl
end

#renderObject



19
20
21
22
23
24
25
26
# File 'lib/cfnbackup/cfhighlander.rb', line 19

def render()
  component = load_component(@component_name)
  Log.logger.debug("Compiling component, saving generated templates to #{@output_dir}")
  compiled = compile_component(component)
  validate_component(component,compiled.cfn_template_paths)
  cfn_template_paths = compiled.cfn_template_paths
  return compiled
end