cloudformation-tool 1.5.14 → 1.5.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/cloud_formation_tool/cloud_formation.rb +48 -41
- data/lib/cloud_formation_tool/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32f485059a283b0a34a74ac687c52fe01b6d9522616cc00beb572b46e9a13e1d
|
4
|
+
data.tar.gz: 9533caf5496a471432cadfbf007dd20a6789829d353642538052bde818ed6bfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd70a1186411fa08ddca90d687c53ad4d5113d503fd02068e6b84e63a3080a11d4dfc9e58f6a8231a90d05ef4ddb5212ece90cae208562a4caef2d54d1eb42c
|
7
|
+
data.tar.gz: f1d758e208b657d5f8e829e4e1dd079850ec4eaa8c1a9593ed09036da9cfe91fc5447edb305d6ed68005a3eda5f2e43df37c7ed4678b03ec8cac745e321af5eb
|
@@ -102,50 +102,36 @@ module CloudFormationTool
|
|
102
102
|
# some categories are meta-data that we can ignore from includes
|
103
103
|
next if %w(AWSTemplateFormatVersion Description).include? category
|
104
104
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
105
|
+
if category == "Parameters"
|
106
|
+
rewriteParameters catdata, cfile_key, rewrites
|
107
|
+
@data["Parameters"].merge! catdata
|
108
|
+
next
|
109
|
+
end
|
110
|
+
|
111
|
+
case catdata
|
112
|
+
when Hash
|
113
|
+
# warn against duplicate entities, resources or outputs
|
114
|
+
(@data[category] ||= {}).keys.each do |key|
|
115
|
+
if catdata.has_key? key
|
116
|
+
raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - duplicate '#{category}' item: #{key}"
|
117
|
+
end
|
118
|
+
end
|
119
|
+
catdata = fixrefs(catdata, rewrites)
|
120
|
+
# add included properties
|
121
|
+
@data[category].merge! catdata
|
122
|
+
when Array
|
123
|
+
if @data[category].nil?
|
124
|
+
@data[category] = catdata
|
125
|
+
elsif @data[category].is_a? Array
|
126
|
+
@data[category] += catdata
|
127
|
+
else
|
128
|
+
raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - conflicting types for '#{category}'"
|
122
129
|
end
|
123
130
|
else
|
124
|
-
|
125
|
-
|
126
|
-
# warn against duplicate entities, resources or outputs
|
127
|
-
(@data[category] ||= {}).keys.each do |key|
|
128
|
-
if catdata.has_key? key
|
129
|
-
raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - duplicate '#{category}' item: #{key}"
|
130
|
-
end
|
131
|
-
end
|
132
|
-
catdata = fixrefs(catdata, rewrites)
|
133
|
-
# add included properties
|
134
|
-
@data[category].merge! catdata
|
135
|
-
when Array
|
136
|
-
if @data[category].nil?
|
137
|
-
@data[category] = catdata
|
138
|
-
elsif @data[category].is_a? Array
|
139
|
-
@data[category] += catdata
|
140
|
-
else
|
141
|
-
raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - conflicting types for '#{category}'"
|
142
|
-
end
|
131
|
+
if @data[category].nil?
|
132
|
+
@data[category] = catdata
|
143
133
|
else
|
144
|
-
|
145
|
-
@data[category] = catdata
|
146
|
-
else
|
147
|
-
raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - I do not know how to merge non-list non-dictionary '#{category}'!"
|
148
|
-
end
|
134
|
+
raise CloudFormationTool::Errors::AppError, "Error compiling #{path} - I do not know how to merge non-list non-dictionary '#{category}'!"
|
149
135
|
end
|
150
136
|
end
|
151
137
|
|
@@ -153,6 +139,27 @@ module CloudFormationTool
|
|
153
139
|
end
|
154
140
|
end
|
155
141
|
|
142
|
+
def rewriteParameters data, key, rewrites
|
143
|
+
(@data["Parameters"]||={}).each do |name, param|
|
144
|
+
unless data.has_key? name
|
145
|
+
@data["Parameters"][name] = param
|
146
|
+
next
|
147
|
+
end
|
148
|
+
|
149
|
+
next if param['Default'] == data[name]['Default']
|
150
|
+
|
151
|
+
if data[name].has_key?('Override') and data[name]['Override'] == false
|
152
|
+
data.delete(name)
|
153
|
+
next
|
154
|
+
end
|
155
|
+
|
156
|
+
newname = "#{key}z#{name}"
|
157
|
+
log "Rewriting conflicting parameter #{name} (='#{data[name]['Default']}') to #{newname}"
|
158
|
+
data[newname] = data.delete name
|
159
|
+
rewrites[name] = newname
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
156
163
|
def resolveVal(value)
|
157
164
|
case value
|
158
165
|
when Hash
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudformation-tool
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oded Arbel
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|