cfndsl 0.15.3 → 0.16.1
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/.rubocop.yml +2 -2
- data/.travis.yml +3 -2
- data/CHANGELOG.md +445 -418
- data/README.md +3 -3
- data/bin/cfndsl +1 -1
- data/cfndsl.gemspec +3 -5
- data/lib/cfndsl/aws/resource_specification.json +14975 -8495
- data/lib/cfndsl/orchestration_template.rb +7 -7
- data/lib/cfndsl/patches.rb +0 -27
- data/lib/cfndsl/specification.rb +1 -1
- data/lib/cfndsl/types.rb +6 -6
- data/lib/cfndsl/version.rb +1 -1
- data/lib/cfnlego.rb +2 -2
- data/lib/cfnlego/resource.rb +1 -1
- data/lib/deep_merge/core.rb +2 -2
- data/lib/deep_merge/deep_merge.rb +1 -1
- data/spec/cfndsl_spec.rb +2 -2
- data/spec/cli_spec.rb +1 -1
- data/spec/types_definition_spec.rb +1 -1
- metadata +8 -4
@@ -83,7 +83,7 @@ module CfnDsl
|
|
83
83
|
define_method(method) do |value = nil, &block|
|
84
84
|
@Properties ||= {}
|
85
85
|
@Properties[pname] ||= PropertyDefinition.new([])
|
86
|
-
value
|
86
|
+
value ||= pclass.new
|
87
87
|
@Properties[pname].value.push value
|
88
88
|
value.instance_eval(&block) if block
|
89
89
|
value
|
@@ -138,11 +138,11 @@ module CfnDsl
|
|
138
138
|
invalids = []
|
139
139
|
@_resource_refs = {}
|
140
140
|
if @Resources
|
141
|
-
@Resources.
|
141
|
+
@Resources.each_key do |resource|
|
142
142
|
@_resource_refs[resource.to_s] = @Resources[resource].build_references({})
|
143
143
|
end
|
144
|
-
@_resource_refs.
|
145
|
-
@_resource_refs[origin].
|
144
|
+
@_resource_refs.each_key do |origin|
|
145
|
+
@_resource_refs[origin].each_key do |ref|
|
146
146
|
invalids.push "Invalid Reference: Resource #{origin} refers to #{ref}" unless valid_ref?(ref, origin)
|
147
147
|
end
|
148
148
|
end
|
@@ -154,11 +154,11 @@ module CfnDsl
|
|
154
154
|
invalids = []
|
155
155
|
output_refs = {}
|
156
156
|
if @Outputs
|
157
|
-
@Outputs.
|
157
|
+
@Outputs.each_key do |resource|
|
158
158
|
output_refs[resource.to_s] = @Outputs[resource].build_references({})
|
159
159
|
end
|
160
|
-
output_refs.
|
161
|
-
output_refs[origin].
|
160
|
+
output_refs.each_key do |origin|
|
161
|
+
output_refs[origin].each_key do |ref|
|
162
162
|
invalids.push "Invalid Reference: Output #{origin} refers to #{ref}" unless valid_ref?(ref)
|
163
163
|
end
|
164
164
|
end
|
data/lib/cfndsl/patches.rb
CHANGED
@@ -40,28 +40,6 @@ module CfnDsl
|
|
40
40
|
'Type' => { 'PrimitiveType' => 'String' },
|
41
41
|
'Value' => { 'PrimitiveType' => 'String' }
|
42
42
|
}
|
43
|
-
},
|
44
|
-
'AWS::EC2::VPNGatewayConnection' => {
|
45
|
-
'Properties' => {
|
46
|
-
'Type' => { 'PrimitiveType' => 'String' },
|
47
|
-
'Tags' => { 'Type' => 'List', 'ItemType' => 'Tag' }
|
48
|
-
}
|
49
|
-
},
|
50
|
-
'AWS::EC2::EIPAssociation' => {
|
51
|
-
'Properties' => {
|
52
|
-
'AllocationId' => { 'PrimitiveType' => 'String' },
|
53
|
-
'EIP' => { 'PrimitiveType' => 'String' },
|
54
|
-
'InstanceId' => { 'PrimitiveType' => 'String' },
|
55
|
-
'NetworkInterfaceId' => { 'PrimitiveType' => 'String' },
|
56
|
-
'PrivateIpAddress' => { 'PrimitiveType' => 'String' }
|
57
|
-
}
|
58
|
-
},
|
59
|
-
'AWS::Config::ConfigurationRecorder' => {
|
60
|
-
'Properties' => {
|
61
|
-
'Name' => { 'PrimitiveType' => 'String' },
|
62
|
-
'RecordingGroup' => { 'Type' => 'RecordingGroup' },
|
63
|
-
'RoleARN' => { 'PrimitiveType' => 'String' }
|
64
|
-
}
|
65
43
|
}
|
66
44
|
}
|
67
45
|
end
|
@@ -86,11 +64,6 @@ module CfnDsl
|
|
86
64
|
'PolicyDocument' => { 'PrimitiveType' => 'Json' },
|
87
65
|
'PolicyName' => { 'PrimitiveType' => 'String' }
|
88
66
|
}
|
89
|
-
},
|
90
|
-
'AWS::Cognito::IdentityPoolRoleAttachment.RulesConfigurationType' => {
|
91
|
-
'Properties' => {
|
92
|
-
'Rules' => { 'Type' => 'List', 'ItemType' => 'MappingRule' }
|
93
|
-
}
|
94
67
|
}
|
95
68
|
}
|
96
69
|
end
|
data/lib/cfndsl/specification.rb
CHANGED
@@ -65,7 +65,7 @@ module CfnDsl
|
|
65
65
|
elsif nested_prop_info['PrimitiveItemType']
|
66
66
|
nested_prop_type = Array(nested_prop_info['PrimitiveItemType'])
|
67
67
|
elsif nested_prop_info['ItemType']
|
68
|
-
nested_prop_type = root_resource_name + nested_prop_info['ItemType']
|
68
|
+
nested_prop_type = Array(root_resource_name + nested_prop_info['ItemType'])
|
69
69
|
elsif nested_prop_info['Type']
|
70
70
|
nested_prop_type = root_resource_name + nested_prop_info['Type']
|
71
71
|
else
|
data/lib/cfndsl/types.rb
CHANGED
@@ -18,10 +18,10 @@ module CfnDsl
|
|
18
18
|
type_def.const_set('Types_Internal', types_list)
|
19
19
|
# Do a little sanity checking - all of the types referenced in Resources
|
20
20
|
# should be represented in Types
|
21
|
-
types_list['Resources'].
|
21
|
+
types_list['Resources'].each_key do |resource_name|
|
22
22
|
resource = types_list['Resources'][resource_name]
|
23
|
-
resource.
|
24
|
-
thing.
|
23
|
+
resource.each_value do |thing|
|
24
|
+
thing.each_value do |type|
|
25
25
|
if type.is_a?(Array)
|
26
26
|
type.each do |inner_type|
|
27
27
|
puts "unknown type #{inner_type}" unless types_list['Types'].key?(inner_type)
|
@@ -36,7 +36,7 @@ module CfnDsl
|
|
36
36
|
# All of the type values should also be references
|
37
37
|
types_list['Types'].values do |type|
|
38
38
|
if type.respond_to?(:values)
|
39
|
-
type.
|
39
|
+
type.each_value do |tv|
|
40
40
|
puts "unknown type #{tv}" unless types_list['Types'].key?(tv)
|
41
41
|
end
|
42
42
|
end
|
@@ -76,13 +76,13 @@ module CfnDsl
|
|
76
76
|
# We are going to modify the value in some
|
77
77
|
# way, make sure that we have an array to mess
|
78
78
|
# with if we start with nothing
|
79
|
-
existing
|
79
|
+
existing ||= instance_variable_set(variable, [])
|
80
80
|
|
81
81
|
# special case for just a block, no args
|
82
82
|
if value.nil? && rest.empty? && block
|
83
83
|
val = klass.new
|
84
84
|
existing.push val
|
85
|
-
|
85
|
+
val.instance_eval(&block)
|
86
86
|
return existing
|
87
87
|
end
|
88
88
|
|
data/lib/cfndsl/version.rb
CHANGED
data/lib/cfnlego.rb
CHANGED
@@ -11,7 +11,7 @@ module Cfnlego
|
|
11
11
|
content = fetch_resource_content
|
12
12
|
supported_resources = JSON.parse(content)
|
13
13
|
resources = []
|
14
|
-
supported_resources['ResourceTypes'].
|
14
|
+
supported_resources['ResourceTypes'].each_key do |resource|
|
15
15
|
resources << resource
|
16
16
|
end
|
17
17
|
resources
|
@@ -35,7 +35,7 @@ module Cfnlego
|
|
35
35
|
begin
|
36
36
|
return Cfnlego::CloudFormation.new(resources).render
|
37
37
|
rescue RuntimeError => e
|
38
|
-
|
38
|
+
warn "Error: #{e.message}"
|
39
39
|
end
|
40
40
|
nil
|
41
41
|
end
|
data/lib/cfnlego/resource.rb
CHANGED
data/lib/deep_merge/core.rb
CHANGED
@@ -204,7 +204,7 @@ module DeepMerge
|
|
204
204
|
end
|
205
205
|
puts "#{di}Returning #{dest.inspect}" if merge_debug
|
206
206
|
dest
|
207
|
-
end
|
207
|
+
end
|
208
208
|
|
209
209
|
# allows deep_merge! to uniformly handle overwriting of unmergeable entities
|
210
210
|
def self.overwrite_unmergeables(source, dest, options)
|
@@ -241,4 +241,4 @@ module DeepMerge
|
|
241
241
|
end
|
242
242
|
obj
|
243
243
|
end
|
244
|
-
end
|
244
|
+
end
|
data/spec/cfndsl_spec.rb
CHANGED
@@ -232,11 +232,11 @@ describe CfnDsl::CloudFormationTemplate do
|
|
232
232
|
|
233
233
|
context 'FnFormat', 'Multiline' do
|
234
234
|
it 'formats correctly' do
|
235
|
-
multiline = <<-
|
235
|
+
multiline = <<-TEXT.gsub(/^ {10}/, '')
|
236
236
|
This is the first line
|
237
237
|
This is the %0 line
|
238
238
|
This is a %% sign
|
239
|
-
|
239
|
+
TEXT
|
240
240
|
func = subject.FnFormat(multiline, 'second')
|
241
241
|
expect(func.to_json).to eq('{"Fn::Join":["",["This is the first line\nThis is the ","second"," line\nThis is a ","%"," sign\n"]]}')
|
242
242
|
end
|
data/spec/cli_spec.rb
CHANGED
@@ -65,7 +65,7 @@ describe 'cfndsl', type: :aruba do
|
|
65
65
|
expect(last_command_started).to have_output_on_stderr(<<-WARN.gsub(/^ {8}/, '').chomp)
|
66
66
|
The creation of constants as config is deprecated!
|
67
67
|
Please switch to the #external_parameters method within your templates to access variables
|
68
|
-
See https://github.com/
|
68
|
+
See https://github.com/cfndsl/cfndsl/issues/170
|
69
69
|
Use the --disable-binding flag to suppress this message
|
70
70
|
WARN
|
71
71
|
end
|
@@ -16,7 +16,7 @@ RSpec.describe 'Type Definitions' do
|
|
16
16
|
resources.each do |name, info|
|
17
17
|
it "#{name} has all property types defined" do
|
18
18
|
properties = info['Properties']
|
19
|
-
properties.
|
19
|
+
properties.each_value do |type|
|
20
20
|
type = type.first if type.is_a?(Array)
|
21
21
|
expect(types).to have_key(type)
|
22
22
|
end
|
metadata
CHANGED
@@ -1,15 +1,17 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfndsl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steven Jack
|
8
8
|
- Chris Howe
|
9
|
+
- Travis Dempsey
|
10
|
+
- Greg Cockburn
|
9
11
|
autorequire:
|
10
12
|
bindir: bin
|
11
13
|
cert_chain: []
|
12
|
-
date: 2017-
|
14
|
+
date: 2017-12-02 00:00:00.000000000 Z
|
13
15
|
dependencies:
|
14
16
|
- !ruby/object:Gem::Dependency
|
15
17
|
name: bundler
|
@@ -29,6 +31,8 @@ description: DSL for creating AWS Cloudformation templates
|
|
29
31
|
email:
|
30
32
|
- stevenmajack@gmail.com
|
31
33
|
- chris@howeville.com
|
34
|
+
- dempsey.travis@gmail.com
|
35
|
+
- gergnz@gmail.com
|
32
36
|
executables:
|
33
37
|
- cfndsl
|
34
38
|
extensions: []
|
@@ -125,7 +129,7 @@ files:
|
|
125
129
|
- spec/support/shared_examples/orchestration_template.rb
|
126
130
|
- spec/transform_spec.rb
|
127
131
|
- spec/types_definition_spec.rb
|
128
|
-
homepage: https://github.com/
|
132
|
+
homepage: https://github.com/cfndsl/cfndsl
|
129
133
|
licenses:
|
130
134
|
- MIT
|
131
135
|
metadata: {}
|
@@ -146,7 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
146
150
|
version: '0'
|
147
151
|
requirements: []
|
148
152
|
rubyforge_project:
|
149
|
-
rubygems_version: 2.
|
153
|
+
rubygems_version: 2.7.3
|
150
154
|
signing_key:
|
151
155
|
specification_version: 4
|
152
156
|
summary: AWS Cloudformation DSL
|