Class: Cfnlego::CloudFormation

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

Overview

CloudFormation

Constant Summary collapse

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(resources) ⇒ CloudFormation

Returns a new instance of CloudFormation.



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

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

Instance Attribute Details

#resourcesObject (readonly)

Returns the value of attribute resources.



7
8
9
# File 'lib/cfnlego/cloudformation.rb', line 7

def resources
  @resources
end

Instance Method Details

#renderObject



14
15
16
17
# File 'lib/cfnlego/cloudformation.rb', line 14

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