Class: Jets::Cfn::Base
Class Method Summary
collapse
Instance Method Summary
collapse
#camelize
#log
Class Method Details
.truncate_id(id, postfix = "") ⇒ Object
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/jets/cfn/base.rb', line 81
def truncate_id(id, postfix = "")
if id.size + postfix.size > 62
"#{id[0..(55 - postfix.size)]}#{Digest::MD5.hexdigest(id)[0..5]}#{postfix}"
else
"#{id}#{postfix}"
end
end
|
Instance Method Details
#attributes ⇒ Object
51
52
53
54
55
|
# File 'lib/jets/cfn/base.rb', line 51
def attributes
attributes = template.values.first
attributes = replacer.replace_placeholders(attributes)
camelize(attributes)
end
|
#config ⇒ Object
76
77
78
|
# File 'lib/jets/cfn/base.rb', line 76
def config
Jets.bootstrap.config
end
|
#logical_id ⇒ Object
37
38
39
40
41
|
# File 'lib/jets/cfn/base.rb', line 37
def logical_id
id = template.keys.first
id = replacer.replace_value(id) Jets::Camelizer.camelize(id) end
|
65
66
67
68
69
70
71
72
73
|
# File 'lib/jets/cfn/base.rb', line 65
def normalize_tags(tags)
if tags.is_a?(Hash)
tags.map do |k, v|
{Key: k.to_s, Value: v.to_s}
end
else tags
end
end
|
#outputs ⇒ Object
61
62
63
|
# File 'lib/jets/cfn/base.rb', line 61
def outputs
{}
end
|
#parameters ⇒ Object
57
58
59
|
# File 'lib/jets/cfn/base.rb', line 57
def parameters
{}
end
|
#properties ⇒ Object
47
48
49
|
# File 'lib/jets/cfn/base.rb', line 47
def properties
attributes[:Properties]
end
|
#replacements ⇒ Object
18
19
20
|
# File 'lib/jets/cfn/base.rb', line 18
def replacements
@replacements || {}
end
|
#replacer ⇒ Object
22
23
24
|
# File 'lib/jets/cfn/base.rb', line 22
def replacer
Resource::Replacer.new(replacements)
end
|
#standarize(*definition) ⇒ Object
#template ⇒ Object
27
28
29
|
# File 'lib/jets/cfn/base.rb', line 27
def template
standarize(definition)
end
|
#type ⇒ Object
43
44
45
|
# File 'lib/jets/cfn/base.rb', line 43
def type
attributes[:Type]
end
|