Class: Cfnlego::CloudFormation

Inherits:
Object
  • Object
show all
Defined in:
lib/cfndsl/cfnlego/cloudformation.rb

Overview

CloudFormation

Constant Summary collapse

TEMPLATE =
"#{File.dirname(__FILE__)}/cloudformation.erb"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources) ⇒ CloudFormation

Returns a new instance of CloudFormation.



11
12
13
14
# File 'lib/cfndsl/cfnlego/cloudformation.rb', line 11

def initialize(resources)
  @description = 'auto generated cloudformation cfndsl template'
  @resources   = resources
end

Instance Attribute Details

#resourcesObject (readonly)

Returns the value of attribute resources.



9
10
11
# File 'lib/cfndsl/cfnlego/cloudformation.rb', line 9

def resources
  @resources
end

Instance Method Details

#renderObject



16
17
18
19
# File 'lib/cfndsl/cfnlego/cloudformation.rb', line 16

def render
  erb = ERB.new(File.read(TEMPLATE), trim_mode: '-')
  erb.result(binding)
end