cfndsl 0.16.10 → 0.16.11

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: 39d9297c9b0b126ba5ca1fdfb8966eddc6510044470b45f78fffc17d7567f523
4
- data.tar.gz: 4f130cc2cb912dde576991edd1fc5b3fe418fbdc7bab360cb35dd8684aaeab44
3
+ metadata.gz: 70fbacb77b806698e3cc84fa8ec6e6186911a9064ab588fad94846678ef5da2e
4
+ data.tar.gz: 49a724e79d6e6a4bc3963c55989af53d79e1e73cbcf24ba06676c81b58356ebe
5
5
  SHA512:
6
- metadata.gz: e6861d876348dbc2c6400704e94707704ba51d3d6ea93defb11c33c16529d42e5a88d8f1b4c1f3ca411e959bd0d21830eabc202c068677aab6e8e1355fe5eaad
7
- data.tar.gz: 70618152664b2c59225bebd0ad0bc0fa7ab59de1865795b7ae157dc143fa13bbb1138e3fa4ccae06813f184e2cfdb2d10b4281adc3d4ef045fc953c3e271047e
6
+ metadata.gz: 89cbae92d59f3fe0f0f1295d101642e9670d696f06ae4503f755517085802d5931f016646a3e0eec224c1aad1db7d9acf30095603164009416aa1b78e2203a48
7
+ data.tar.gz: b3a8f19addfa8ec7096915013d7be86e294c743906ed0fc9f3bc4c57a152f9284fb94c285cf8b740c5c923dcabdf13a7a970edf5116c3d896cb6cb1ac58dabca
@@ -1,7 +1,15 @@
1
1
  # Change Log
2
2
 
3
- ## [0.16.10](https://github.com/cfndsl/cfndsl/tree/0.16.10) (2019-02-13)
4
- [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v1.0.0.pre...0.16.10)
3
+ ## [0.16.11](https://github.com/cfndsl/cfndsl/tree/0.16.11) (2019-02-22)
4
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.16.10...0.16.11)
5
+
6
+ **Merged pull requests:**
7
+
8
+ - Add VPCEndpoint resource to address \#398 [\#399](https://github.com/cfndsl/cfndsl/pull/399) ([cfarrend](https://github.com/cfarrend))
9
+ - handle simple resource types [\#397](https://github.com/cfndsl/cfndsl/pull/397) ([gergnz](https://github.com/gergnz))
10
+
11
+ ## [v0.16.10](https://github.com/cfndsl/cfndsl/tree/v0.16.10) (2019-02-13)
12
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v1.0.0.pre...v0.16.10)
5
13
 
6
14
  **Implemented enhancements:**
7
15
 
@@ -6,6 +6,18 @@ module CfnDsl
6
6
  # rubocop:disable Metrics/MethodLength
7
7
  def self.resources
8
8
  {
9
+ 'AWS::EC2::VPCEndpoint' => {
10
+ 'Properties' => {
11
+ 'PolicyDocument' => { 'PrimitiveType' => 'Json' },
12
+ 'PrivateDnsEnabled' => { 'PrimitiveType' => 'Boolean' },
13
+ 'RouteTableIds' => { 'PrimitiveType' => 'String' },
14
+ 'SecurityGroupIds' => { 'PrimitiveType' => 'String' },
15
+ 'ServiceName' => { 'PrimitiveType' => 'String' },
16
+ 'SubnetIds' => { 'PrimitiveType' => 'String' },
17
+ 'VpcEndpointType' => { 'PrimitiveType' => 'String' },
18
+ 'VpcId' => { 'PrimitiveType' => 'String' }
19
+ }
20
+ },
9
21
  'AWS::Serverless::Function' => {
10
22
  'Properties' => {
11
23
  'Handler' => { 'PrimitiveType' => 'String' },
@@ -38,7 +38,7 @@ module CfnDsl
38
38
  end
39
39
  # rubocop:enable Metrics/AbcSize, Metrics/PerceivedComplexity
40
40
 
41
- # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity
41
+ # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
42
42
  def self.extract_types(spec)
43
43
  primitive_types = {
44
44
  'String' => 'String',
@@ -58,31 +58,36 @@ module CfnDsl
58
58
  root_resource = property_name.match(/(.*)\./)
59
59
  root_resource_name = root_resource ? root_resource[1].gsub(/::/, '') : property_name
60
60
  property_name = property_name.gsub(/::|\./, '')
61
- next unless property_info['Properties']
62
61
 
63
- properties = property_info['Properties'].each_with_object({}) do |(nested_prop_name, nested_prop_info), extracted|
64
- if nested_prop_info['Type'] == 'Map' || nested_prop_info['Type'] == 'Json'
65
- # The Map type and the incorrectly labelled Json type
66
- nested_prop_type = 'Json'
67
- elsif nested_prop_info['PrimitiveType']
68
- nested_prop_type = nested_prop_info['PrimitiveType']
69
- elsif nested_prop_info['PrimitiveItemType']
70
- nested_prop_type = Array(nested_prop_info['PrimitiveItemType'])
71
- elsif nested_prop_info['ItemType']
72
- nested_prop_type = Array(root_resource_name + nested_prop_info['ItemType'])
73
- elsif nested_prop_info['Type']
74
- nested_prop_type = root_resource_name + nested_prop_info['Type']
75
- else
76
- warn "could not extract type from #{property_name}"
62
+ if property_info.key?('PrimitiveType')
63
+ properties = property_info['PrimitiveType']
64
+ elsif property_info.key?('Type')
65
+ properties = property_info['Type']
66
+ elsif property_info.key?('Properties')
67
+ properties = property_info['Properties'].each_with_object({}) do |(nested_prop_name, nested_prop_info), extracted|
68
+ if nested_prop_info['Type'] == 'Map' || nested_prop_info['Type'] == 'Json'
69
+ # The Map type and the incorrectly labelled Json type
70
+ nested_prop_type = 'Json'
71
+ elsif nested_prop_info['PrimitiveType']
72
+ nested_prop_type = nested_prop_info['PrimitiveType']
73
+ elsif nested_prop_info['PrimitiveItemType']
74
+ nested_prop_type = Array(nested_prop_info['PrimitiveItemType'])
75
+ elsif nested_prop_info['ItemType']
76
+ nested_prop_type = Array(root_resource_name + nested_prop_info['ItemType'])
77
+ elsif nested_prop_info['Type']
78
+ nested_prop_type = root_resource_name + nested_prop_info['Type']
79
+ else
80
+ warn "could not extract type from #{property_name}"
81
+ end
82
+ extracted[nested_prop_name] = nested_prop_type
83
+ extracted
77
84
  end
78
- extracted[nested_prop_name] = nested_prop_type
79
- extracted
80
85
  end
81
86
  types[property_name] = properties
82
87
  types
83
88
  end
84
89
  end
85
- # rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity
90
+ # rubocop:enable Metrics/MethodLength, Metrics/AbcSize, Metrics/PerceivedComplexity, Metrics/CyclomaticComplexity
86
91
 
87
92
  def self.determine_spec_file
88
93
  return CfnDsl.specification_file if File.exist? CfnDsl.specification_file
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = '0.16.10'.freeze
2
+ VERSION = '0.16.11'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfndsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.10
4
+ version: 0.16.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Jack
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2019-02-13 00:00:00.000000000 Z
14
+ date: 2019-02-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler