cfndsl 0.16.10 → 0.16.11
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/CHANGELOG.md +10 -2
- data/lib/cfndsl/patches.rb +12 -0
- data/lib/cfndsl/specification.rb +24 -19
- data/lib/cfndsl/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: 70fbacb77b806698e3cc84fa8ec6e6186911a9064ab588fad94846678ef5da2e
|
4
|
+
data.tar.gz: 49a724e79d6e6a4bc3963c55989af53d79e1e73cbcf24ba06676c81b58356ebe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89cbae92d59f3fe0f0f1295d101642e9670d696f06ae4503f755517085802d5931f016646a3e0eec224c1aad1db7d9acf30095603164009416aa1b78e2203a48
|
7
|
+
data.tar.gz: b3a8f19addfa8ec7096915013d7be86e294c743906ed0fc9f3bc4c57a152f9284fb94c285cf8b740c5c923dcabdf13a7a970edf5116c3d896cb6cb1ac58dabca
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## [0.16.
|
4
|
-
[Full Changelog](https://github.com/cfndsl/cfndsl/compare/
|
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
|
|
data/lib/cfndsl/patches.rb
CHANGED
@@ -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' },
|
data/lib/cfndsl/specification.rb
CHANGED
@@ -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
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
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
|
data/lib/cfndsl/version.rb
CHANGED
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.
|
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-
|
14
|
+
date: 2019-02-22 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|