sparkle_formation 3.0.26 → 3.0.28
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 +5 -5
- data/CHANGELOG.md +6 -0
- data/lib/sparkle_formation/composition.rb +17 -17
- data/lib/sparkle_formation/error.rb +2 -5
- data/lib/sparkle_formation/function_struct.rb +27 -31
- data/lib/sparkle_formation/provider/aws.rb +32 -31
- data/lib/sparkle_formation/provider/azure.rb +18 -19
- data/lib/sparkle_formation/provider/google.rb +20 -22
- data/lib/sparkle_formation/provider/heat.rb +17 -17
- data/lib/sparkle_formation/provider/terraform.rb +14 -15
- data/lib/sparkle_formation/provider.rb +0 -2
- data/lib/sparkle_formation/resources/aws.rb +129 -149
- data/lib/sparkle_formation/resources/aws_resources.json +9208 -5542
- data/lib/sparkle_formation/resources/azure.rb +2 -5
- data/lib/sparkle_formation/resources/azure_resources.json +12367 -2901
- data/lib/sparkle_formation/resources/google.rb +1 -4
- data/lib/sparkle_formation/resources/heat.rb +0 -4
- data/lib/sparkle_formation/resources/heat_resources.json +2616 -2062
- data/lib/sparkle_formation/resources/rackspace.rb +0 -4
- data/lib/sparkle_formation/resources/terraform.rb +2 -6
- data/lib/sparkle_formation/resources.rb +20 -24
- data/lib/sparkle_formation/sparkle.rb +56 -66
- data/lib/sparkle_formation/sparkle_attribute/aws.rb +61 -34
- data/lib/sparkle_formation/sparkle_attribute/azure.rb +12 -8
- data/lib/sparkle_formation/sparkle_attribute/google.rb +18 -15
- data/lib/sparkle_formation/sparkle_attribute/heat.rb +22 -7
- data/lib/sparkle_formation/sparkle_attribute/rackspace.rb +0 -2
- data/lib/sparkle_formation/sparkle_attribute/terraform.rb +11 -5
- data/lib/sparkle_formation/sparkle_attribute.rb +13 -7
- data/lib/sparkle_formation/sparkle_collection/rainbow.rb +5 -7
- data/lib/sparkle_formation/sparkle_collection.rb +13 -15
- data/lib/sparkle_formation/sparkle_formation.rb +116 -112
- data/lib/sparkle_formation/sparkle_struct.rb +30 -24
- data/lib/sparkle_formation/translation/heat.rb +57 -58
- data/lib/sparkle_formation/translation/rackspace.rb +48 -49
- data/lib/sparkle_formation/translation.rb +34 -37
- data/lib/sparkle_formation/utils.rb +6 -13
- data/lib/sparkle_formation/version.rb +1 -1
- data/sparkle_formation.gemspec +1 -1
- metadata +9 -9
@@ -14,254 +14,237 @@ class SparkleFormation
|
|
14
14
|
'GlobalSecondaryIndexes' => [
|
15
15
|
# Updates not really supported here. Set as unknown to
|
16
16
|
# prompt user to investigate
|
17
|
-
UpdateCausesConditional.new('unknown', true)
|
18
|
-
]
|
17
|
+
UpdateCausesConditional.new('unknown', true),
|
18
|
+
],
|
19
19
|
},
|
20
20
|
'AWS::EC2::EIPAssociation' => {
|
21
21
|
'AllocationId' => [
|
22
22
|
UpdateCausesConditional.new('replacement',
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
),
|
28
|
-
UpdateCausesConditional.new('none', true)
|
23
|
+
lambda { |final, original|
|
24
|
+
original.get('Properties', 'InstanceId') != final.get('Properties', 'InstanceId') ||
|
25
|
+
original.get('Properties', 'NetworkInterfaceId') != final.get('Properties', 'NewtorkInterfaceId')
|
26
|
+
}),
|
27
|
+
UpdateCausesConditional.new('none', true),
|
29
28
|
],
|
30
29
|
'EIP' => [
|
31
30
|
UpdateCausesConditional.new('replacement',
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
),
|
37
|
-
UpdateCausesConditional.new('none', true)
|
31
|
+
lambda { |final, original|
|
32
|
+
original.get('Properties', 'InstanceId') != final.get('Properties', 'InstanceId') ||
|
33
|
+
original.get('Properties', 'NetworkInterfaceId') != final.get('Properties', 'NewtorkInterfaceId')
|
34
|
+
}),
|
35
|
+
UpdateCausesConditional.new('none', true),
|
38
36
|
],
|
39
37
|
'InstanceId' => [
|
40
38
|
UpdateCausesConditional.new('replacement',
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
),
|
46
|
-
UpdateCausesConditional.new('none', true)
|
39
|
+
lambda { |final, original|
|
40
|
+
original.get('Properties', 'AllocationId') != final.get('Properties', 'AllocationId') ||
|
41
|
+
original.get('Properties', 'EIP') != final.get('Properties', 'EIP')
|
42
|
+
}),
|
43
|
+
UpdateCausesConditional.new('none', true),
|
47
44
|
],
|
48
45
|
'NetworkInterfaceId' => [
|
49
46
|
UpdateCausesConditional.new('replacement',
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
),
|
55
|
-
|
56
|
-
]
|
47
|
+
lambda { |final, original|
|
48
|
+
original.get('Properties', 'AllocationId') != final.get('Properties', 'AllocationId') ||
|
49
|
+
original.get('Properties', 'EIP') != final.get('Properties', 'EIP')
|
50
|
+
}),
|
51
|
+
UpdateCausesConditional.new('none', true),
|
52
|
+
],
|
57
53
|
},
|
58
54
|
'AWS::EC2::Instance' => {
|
59
55
|
'AdditionalInfo' => [
|
60
|
-
UpdateCausesConditional.new('unknown', true) # EBS AMI dependent
|
56
|
+
UpdateCausesConditional.new('unknown', true), # EBS AMI dependent
|
61
57
|
],
|
62
58
|
'BlockDeviceMappings' => [
|
63
59
|
UpdateCausesConditional.new('replacement',
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
),
|
79
|
-
UpdateCausesConditional.new('none', true)
|
60
|
+
lambda { |final, original|
|
61
|
+
f_maps = final.fetch('Properties', 'BlockDeviceMappings', [])
|
62
|
+
o_maps = original.fetch('Properties', 'BlockDeviceMappings', [])
|
63
|
+
f_maps.map! do |m|
|
64
|
+
m.delete('DeleteOnTermination')
|
65
|
+
m.to_smash(:sorted)
|
66
|
+
end
|
67
|
+
o_maps.map! do |m|
|
68
|
+
m.delete('DeleteOnTermination')
|
69
|
+
m.to_smash(:sorted)
|
70
|
+
end
|
71
|
+
f_maps.size != o_maps.size ||
|
72
|
+
!f_maps.all? { |m| o_maps.include?(m) }
|
73
|
+
}),
|
74
|
+
UpdateCausesConditional.new('none', true),
|
80
75
|
],
|
81
76
|
'EbsOptimized' => [
|
82
|
-
UpdateCausesConditional.new('unknown', true) # EBS AMI dependent
|
77
|
+
UpdateCausesConditional.new('unknown', true), # EBS AMI dependent
|
83
78
|
],
|
84
79
|
'InstanceType' => [
|
85
|
-
UpdateCausesConditional.new('unknown', true) # EBS AMI dependent
|
80
|
+
UpdateCausesConditional.new('unknown', true), # EBS AMI dependent
|
86
81
|
],
|
87
82
|
'KernelId' => [
|
88
|
-
UpdateCausesConditional.new('unknown', true) # EBS AMI dependent
|
83
|
+
UpdateCausesConditional.new('unknown', true), # EBS AMI dependent
|
89
84
|
],
|
90
85
|
'RamdiskId' => [
|
91
|
-
UpdateCausesConditional.new('unknown', true) # EBS AMI dependent
|
86
|
+
UpdateCausesConditional.new('unknown', true), # EBS AMI dependent
|
92
87
|
],
|
93
88
|
'SecurityGroupIds' => [
|
94
89
|
UpdateCausesConditional.new('none',
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
),
|
100
|
-
UpdateCausesConditional.new('replacement', true)
|
90
|
+
lambda { |final, _orig|
|
91
|
+
final.get('Properties', 'SubnetId') ||
|
92
|
+
final.fetch('Properties', 'NetworkInterface', {}).values.include?('SubnetId')
|
93
|
+
}),
|
94
|
+
UpdateCausesConditional.new('replacement', true),
|
101
95
|
],
|
102
96
|
'UserData' => [
|
103
|
-
UpdateCausesConditional.new('unknown', true) # EBS AMI dependent
|
104
|
-
]
|
97
|
+
UpdateCausesConditional.new('unknown', true), # EBS AMI dependent
|
98
|
+
],
|
105
99
|
},
|
106
100
|
'AWS::EC2::NetworkInterface' => {
|
107
101
|
'PrivateIpAddresses' => [
|
108
102
|
UpdateCausesConditional.new('replacement',
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
),
|
119
|
-
|
120
|
-
]
|
103
|
+
lambda { |final, original|
|
104
|
+
f_primary = final.fetch('Properties', 'PrivateIpAddresses', []).detect do |addr|
|
105
|
+
addr['Primary']
|
106
|
+
end || Smash.new
|
107
|
+
o_primary = original.fetch('Properties', 'PrivateIpAddresses', []).detect do |addr|
|
108
|
+
addr['Primary']
|
109
|
+
end || Smash.new
|
110
|
+
f_primary.to_smash(:sorted) != o_primary.to_smash(:sorted)
|
111
|
+
}),
|
112
|
+
UpdateCausesConditional.new('none', true),
|
113
|
+
],
|
121
114
|
},
|
122
115
|
'AWS::ElastiCache::CacheCluster' => {
|
123
116
|
'NumCacheNodes' => [
|
124
117
|
UpdateCausesConditional.new('replacement',
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
),
|
134
|
-
UpdateCausesConditional.new('none', true)
|
118
|
+
lambda { |final, original|
|
119
|
+
[
|
120
|
+
final.get('Properties', 'PreferredAvailabilityZone'),
|
121
|
+
final.get('Properties', 'PreferredAvailabilityZones'),
|
122
|
+
original.get('Properties', 'PreferredAvailabilityZone'),
|
123
|
+
original.get('Properties', 'PreferredAvailabilityZones'),
|
124
|
+
].all? { |i| i.nil? || i.empty? }
|
125
|
+
}),
|
126
|
+
UpdateCausesConditional.new('none', true),
|
135
127
|
],
|
136
128
|
'PreferredAvailabilityZones' => [
|
137
129
|
UpdateCausesConditional.new('interrupt',
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
130
|
+
lambda { |final, original|
|
131
|
+
original.get('Properties', 'PreferredAvailabilityZones') ||
|
132
|
+
final.fetch('Properties', 'PreferredAvailabilityZones', []).include?(
|
133
|
+
original.get('Properties', 'PreferredAvailabilityZone')
|
142
134
|
)
|
143
|
-
|
144
|
-
),
|
145
|
-
|
146
|
-
]
|
135
|
+
}),
|
136
|
+
UpdateCausesConditional.new('replacement', true),
|
137
|
+
],
|
147
138
|
},
|
148
139
|
'AWS::ElasticLoadBalancing::LoadBalancer' => {
|
149
140
|
'AvailabilityZones' => [
|
150
141
|
UpdateCausesConditional.new('replacement',
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
),
|
156
|
-
UpdateCausesConditional.new('none', true)
|
142
|
+
lambda { |final, original|
|
143
|
+
original.fetch('Properties', 'AvailabilityZones', []).empty? ||
|
144
|
+
final.fetch('Properties', 'AvailabilityZones', []).empty?
|
145
|
+
}),
|
146
|
+
UpdateCausesConditional.new('none', true),
|
157
147
|
],
|
158
148
|
'HealthCheck' => [
|
159
149
|
UpdateCausesConditional.new('replacement',
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
),
|
165
|
-
UpdateCausesConditional.new('none', true)
|
150
|
+
lambda { |final, original|
|
151
|
+
original.fetch('Properties', 'HealthCheck', {}).empty? ||
|
152
|
+
final.fetch('Properties', 'HealthCheck', {}).empty?
|
153
|
+
}),
|
154
|
+
UpdateCausesConditional.new('none', true),
|
166
155
|
],
|
167
156
|
'Subnets' => [
|
168
157
|
UpdateCausesConditional.new('replacement',
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
),
|
174
|
-
|
175
|
-
]
|
158
|
+
lambda { |final, original|
|
159
|
+
original.fetch('Properties', 'Subnets', []).empty? ||
|
160
|
+
final.fetch('Properties', 'Subnets', []).empty?
|
161
|
+
}),
|
162
|
+
UpdateCausesConditional.new('none', true),
|
163
|
+
],
|
176
164
|
},
|
177
165
|
'AWS::RDS::DBCluster' => {
|
178
166
|
'BackupRetentionPeriod' => [
|
179
167
|
UpdateCausesConditional.new('interrupt',
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
),
|
187
|
-
UpdateCausesConditional.new('none', true)
|
168
|
+
lambda { |final, original|
|
169
|
+
fp = final.get('Properties', 'BackupRetentionPeriod').to_i
|
170
|
+
op = original.get('Properties', 'BackupRetentionPeriod').to_i
|
171
|
+
(fp == 0 && op != 0) ||
|
172
|
+
(op == 0 && fp != 0)
|
173
|
+
}),
|
174
|
+
UpdateCausesConditional.new('none', true),
|
188
175
|
],
|
189
176
|
'PreferredMaintenanceWindow' => [
|
190
177
|
# can interrupt if apply immediately is set on api call but
|
191
178
|
# no way to know
|
192
|
-
UpdateCausesConditional.new('unknown', true)
|
193
|
-
]
|
179
|
+
UpdateCausesConditional.new('unknown', true),
|
180
|
+
],
|
194
181
|
},
|
195
182
|
'AWS::RDS::DBClusterParameterGroup' => {
|
196
183
|
'Parameters' => [
|
197
184
|
# dependent on what parameters have been changed. doesn't
|
198
185
|
# look like parameter modifications are applied immediately?
|
199
186
|
# set as unknown for safety
|
200
|
-
UpdateCausesConditional.new('unknown', true)
|
201
|
-
]
|
187
|
+
UpdateCausesConditional.new('unknown', true),
|
188
|
+
],
|
202
189
|
},
|
203
190
|
'AWS::RDS::DBInstance' => {
|
204
191
|
'AutoMinorVersionUpgrade' => [
|
205
192
|
# can cause interrupts based on future actions (enables
|
206
193
|
# auto patching) so leave as unknown for safety
|
207
|
-
UpdateCausesConditional.new('unknown', true)
|
194
|
+
UpdateCausesConditional.new('unknown', true),
|
208
195
|
],
|
209
196
|
'BackupRetentionPeriod' => [
|
210
197
|
UpdateCausesConditional.new('interrupt',
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
),
|
218
|
-
UpdateCausesConditional.new('none', true)
|
198
|
+
lambda { |final, original|
|
199
|
+
fp = final.get('Properties', 'BackupRetentionPeriod').to_i
|
200
|
+
op = original.get('Properties', 'BackupRetentionPeriod').to_i
|
201
|
+
(fp == 0 && op != 0) ||
|
202
|
+
(op == 0 && fp != 0)
|
203
|
+
}),
|
204
|
+
UpdateCausesConditional.new('none', true),
|
219
205
|
],
|
220
206
|
'DBParameterGroupName' => [
|
221
207
|
# changes are not applied until reboot, but it could
|
222
208
|
# still be considered an interrupt? setting as unknown
|
223
209
|
# for safety
|
224
|
-
UpdateCausesConditional.new('unknown', true)
|
210
|
+
UpdateCausesConditional.new('unknown', true),
|
225
211
|
],
|
226
212
|
'PreferredMaintenanceWindow' => [
|
227
213
|
# can interrupt if apply immediately is set on api call but
|
228
214
|
# no way to know
|
229
|
-
UpdateCausesConditional.new('unknown', true)
|
230
|
-
]
|
215
|
+
UpdateCausesConditional.new('unknown', true),
|
216
|
+
],
|
231
217
|
},
|
232
218
|
'AWS::RDS::DBParameterGroup' => {
|
233
219
|
'Parameters' => [
|
234
220
|
# dependent on what parameters have been changed. doesn't
|
235
221
|
# look like parameter modifications are applied immediately?
|
236
222
|
# set as unknown for safety
|
237
|
-
UpdateCausesConditional.new('unknown', true)
|
238
|
-
]
|
223
|
+
UpdateCausesConditional.new('unknown', true),
|
224
|
+
],
|
239
225
|
},
|
240
226
|
'AWS::RDS::EventSubscription' => {
|
241
227
|
'SourceType' => [
|
242
228
|
UpdateCausesConditional.new('replacement',
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
),
|
247
|
-
|
248
|
-
]
|
229
|
+
lambda { |final, original|
|
230
|
+
!final.get('Properties', 'SourceType')
|
231
|
+
}),
|
232
|
+
UpdateCausesConditional.new('none', true),
|
233
|
+
],
|
249
234
|
},
|
250
235
|
'AWS::Route53::HostedZone' => {
|
251
236
|
'VPCs' => [
|
252
237
|
UpdateCausesConditional.new('replacement',
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
),
|
258
|
-
|
259
|
-
|
260
|
-
}
|
238
|
+
lambda { |final, original|
|
239
|
+
!final.get('Properties', 'VPCs') ||
|
240
|
+
!original.get('Properties', 'VPCs')
|
241
|
+
}),
|
242
|
+
UpdateCausesConditional.new('none', true),
|
243
|
+
],
|
244
|
+
},
|
261
245
|
)
|
262
246
|
|
263
247
|
class << self
|
264
|
-
|
265
248
|
include Bogo::Memoization
|
266
249
|
|
267
250
|
# Load the builtin AWS resources
|
@@ -283,10 +266,7 @@ class SparkleFormation
|
|
283
266
|
def included(_klass)
|
284
267
|
load!
|
285
268
|
end
|
286
|
-
|
287
269
|
end
|
288
270
|
end
|
289
|
-
|
290
271
|
end
|
291
|
-
|
292
272
|
end
|