cfn-model 0.1.34 → 0.1.35

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2252a81f1e396649742309655d34f3cd711c60708cd82601cf2912b4d8bb6556
4
- data.tar.gz: 5f8b0c5f694c3648d616a7e31516a2792a1ff7049852970dcf992aa3c0163ce1
3
+ metadata.gz: 4a7c23dabd4b1d3f0f73056e8ae9fcbe2e973937832985cf60373dd0bde5587c
4
+ data.tar.gz: 580030b0d1dde7a33caed7d31a9a300e37112bcb679b8460a1959433b2df194e
5
5
  SHA512:
6
- metadata.gz: 956e8af4748a41ac9774d314566a1c4955dacf7d329774a705a075d8a8de2e0731935660120b872047894187ebfa6b8d0e6ee1dcf31dc9b7ccdf0060ae39794d
7
- data.tar.gz: 0498547be1a0666721dcd0e6aeccc825a3af5aefba9269a1e1fccbaabd139eb07f431bce703edc4eb8b858aaa8288243d199b87ed508273168a960793decc65a
6
+ metadata.gz: bf866a4c4bf188ad8dcc96564a577df0f072c8333c63467091f60b2092c156dcbbffb3ecb2b1783862c9256ea6c31580071af19a752a9a8cd28d53675b939c47
7
+ data.tar.gz: 14279bb0655dc6510d06660311b2c2c88bf7ab4cf335d52d68e29088b9fc3e9b4e6002a441abc985bad0333e1b3d811717f86a42ab0444a9a5cf13a793427b9b
@@ -9,12 +9,26 @@ class ReferenceValidator
9
9
  end
10
10
 
11
11
  resource_keys = cloudformation_hash['Resources'].keys
12
- missing_refs = all_references(cloudformation_hash) - Set.new(parameter_keys + resource_keys)
13
- missing_refs
12
+
13
+ legal_identifiers = Set.new(parameter_keys + resource_keys)
14
+ missing_refs = all_references(cloudformation_hash) - legal_identifiers
15
+ post_process_special_refs(missing_refs, legal_identifiers)
14
16
  end
15
17
 
16
18
  private
17
19
 
20
+ SPECIAL_REF_REGEXP = /(.+)\..+/
21
+
22
+ def post_process_special_refs(missing_refs, legal_identifiers)
23
+ missing_refs.delete_if do |missing_ref|
24
+ match_data = missing_ref.match SPECIAL_REF_REGEXP
25
+ if match_data
26
+ resource_id = match_data[1]
27
+ legal_identifiers.member?(resource_id)
28
+ end
29
+ end
30
+ end
31
+
18
32
  def all_references(cloudformation_hash)
19
33
  result = Set.new
20
34
  cloudformation_hash['Resources'].values.each do |resource_hash|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.34
4
+ version: 0.1.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kascic