Module: Cfnlego
- Defined in:
- lib/cfnlego.rb,
lib/cfnlego/resource.rb,
lib/cfnlego/cloudformation.rb
Overview
Defined Under Namespace
Classes: CloudFormation, Resource
Class Method Summary
collapse
Class Method Details
.fetch_resource_content ⇒ Object
.Resources ⇒ Object
10
11
12
13
14
15
16
17
18
|
# File 'lib/cfnlego.rb', line 10
def self.Resources
content = fetch_resource_content
supported_resources = JSON.parse(content)
resources = []
supported_resources['ResourceTypes'].each_key do |resource|
resources << resource
end
resources
end
|
.run(options) ⇒ Object
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
# File 'lib/cfnlego.rb', line 24
def self.run(options)
resources = []
options[:resources].each do |r|
/(.*),(.*)/.match(r) do |m|
type = m[1]
name = m[2]
resources << Cfnlego::Resource.new(type, name)
end
end
begin
return Cfnlego::CloudFormation.new(resources).render
rescue RuntimeError => e
warn "Error: #{e.message}"
end
nil
end
|