cfndsl 0.16.9 → 0.16.10

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f221cb6dcd91c7c77e47c33e5505e9bf403be039798d939f7d56bde6fa4e34c0
4
- data.tar.gz: d1bf20095128c3161b87a2d479a17996bf8bcc54153a2a988efb973788235aea
3
+ metadata.gz: 39d9297c9b0b126ba5ca1fdfb8966eddc6510044470b45f78fffc17d7567f523
4
+ data.tar.gz: 4f130cc2cb912dde576991edd1fc5b3fe418fbdc7bab360cb35dd8684aaeab44
5
5
  SHA512:
6
- metadata.gz: 30a898f5a8d41868b0b0d40832055a53b31e138ed5eae65b28df7f54966662af33f0a6c3328d6d0f36bf88133ea5bc83d8de1b28991b11ef46d3fe1a42a8aaf0
7
- data.tar.gz: 5f49a21b96cc5c4e8468a19e9bad3bd30af9483c822b296a47304af83503da5067c3d2e3226b39633f455ff5e2fd078c569436dd1993df1bc96dbbbf24e9a2c1
6
+ metadata.gz: e6861d876348dbc2c6400704e94707704ba51d3d6ea93defb11c33c16529d42e5a88d8f1b4c1f3ca411e959bd0d21830eabc202c068677aab6e8e1355fe5eaad
7
+ data.tar.gz: 70618152664b2c59225bebd0ad0bc0fa7ab59de1865795b7ae157dc143fa13bbb1138e3fa4ccae06813f184e2cfdb2d10b4281adc3d4ef045fc953c3e271047e
@@ -1,7 +1,45 @@
1
1
  # Change Log
2
2
 
3
- ## [0.16.9](https://github.com/cfndsl/cfndsl/tree/0.16.9) (2018-12-08)
4
- [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17-pre...0.16.9)
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)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - offer option to 'lock' resource\_specification.json version - Fix for \#393 [\#395](https://github.com/cfndsl/cfndsl/pull/395) ([blofeldthefish](https://github.com/blofeldthefish))
9
+
10
+ **Closed issues:**
11
+
12
+ - confirm we are using gzip download of cloudfomration specification. [\#394](https://github.com/cfndsl/cfndsl/issues/394)
13
+ - support a version for cfndsl -u [\#393](https://github.com/cfndsl/cfndsl/issues/393)
14
+
15
+ ## [v1.0.0.pre](https://github.com/cfndsl/cfndsl/tree/v1.0.0.pre) (2019-01-19)
16
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17.pre.6...v1.0.0.pre)
17
+
18
+ **Closed issues:**
19
+
20
+ - 'require': cannot load such file -- hana \(0.17.pre.5\) [\#387](https://github.com/cfndsl/cfndsl/issues/387)
21
+
22
+ ## [v0.17.pre.6](https://github.com/cfndsl/cfndsl/tree/v0.17.pre.6) (2018-12-10)
23
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17.pre.5...v0.17.pre.6)
24
+
25
+ ## [v0.17.pre.5](https://github.com/cfndsl/cfndsl/tree/v0.17.pre.5) (2018-12-09)
26
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17.pre.4...v0.17.pre.5)
27
+
28
+ ## [v0.17.pre.4](https://github.com/cfndsl/cfndsl/tree/v0.17.pre.4) (2018-12-09)
29
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17.pre.3...v0.17.pre.4)
30
+
31
+ ## [v0.17.pre.3](https://github.com/cfndsl/cfndsl/tree/v0.17.pre.3) (2018-12-09)
32
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17.pre.2...v0.17.pre.3)
33
+
34
+ **Merged pull requests:**
35
+
36
+ - implement json patch for patches and pull in patches from CDK [\#386](https://github.com/cfndsl/cfndsl/pull/386) ([gergnz](https://github.com/gergnz))
37
+
38
+ ## [v0.17.pre.2](https://github.com/cfndsl/cfndsl/tree/v0.17.pre.2) (2018-12-09)
39
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.16.9...v0.17.pre.2)
40
+
41
+ ## [v0.16.9](https://github.com/cfndsl/cfndsl/tree/v0.16.9) (2018-12-07)
42
+ [Full Changelog](https://github.com/cfndsl/cfndsl/compare/v0.17-pre...v0.16.9)
5
43
 
6
44
  **Closed issues:**
7
45
 
data/README.md CHANGED
@@ -439,7 +439,8 @@ Usage: cfndsl [options] FILE
439
439
  -b, --disable-binding Disable binding configuration
440
440
  -m, --disable-deep-merge Disable deep merging of yaml
441
441
  -s, --specification-file FILE Location of Cloudformation Resource Specification file
442
- -u, --update-specification Update the Cloudformation Resource Specification file
442
+ -u [VERSION], Update the Resource Specification file to latest, or specific version
443
+ --update-specification
443
444
  -g RESOURCE_TYPE,RESOURCE_LOGICAL_NAME,
444
445
  --generate Add resource type and logical name
445
446
  -l, --list List supported resources
data/bin/cfndsl CHANGED
@@ -64,7 +64,8 @@ optparse = OptionParser.new do |opts|
64
64
  CfnDsl.specification_file File.expand_path(file)
65
65
  end
66
66
 
67
- opts.on('-u', '--update-specification', 'Update the Cloudformation Resource Specification file') do
67
+ opts.on('-u', '--update-specification [VERSION]', 'Update the Resource Specification file to latest, or specific version') do |file|
68
+ options[:spec_version] = file || 'latest'.freeze
68
69
  options[:update_spec] = true
69
70
  end
70
71
 
@@ -95,7 +96,12 @@ optparse.parse!
95
96
  if options[:update_spec]
96
97
  STDERR.puts 'Updating specification file'
97
98
  FileUtils.mkdir_p File.dirname(CfnDsl.specification_file)
98
- content = open('https://d1uauaxba7bl26.cloudfront.net/latest/CloudFormationResourceSpecification.json').read
99
+ begin
100
+ content = open("https://d1uauaxba7bl26.cloudfront.net/#{options[:spec_version]}/gzip/CloudFormationResourceSpecification.json").read
101
+ rescue OpenURI::HTTPError
102
+ STDERR.puts "Resource Specification version #{options[:spec_version]} not found, defaulting to 'latest'"
103
+ content = open('https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json').read
104
+ end
99
105
  File.open(CfnDsl.specification_file, 'w') { |f| f.puts content }
100
106
  STDERR.puts "Specification successfully written to #{CfnDsl.specification_file}"
101
107
  end
@@ -1,3 +1,3 @@
1
1
  module CfnDsl
2
- VERSION = '0.16.9'.freeze
2
+ VERSION = '0.16.10'.freeze
3
3
  end
@@ -1,5 +1,7 @@
1
1
  require 'spec_helper'
2
2
 
3
+ WORKING_SPEC_VERSION = '2.19.0'.freeze
4
+
3
5
  describe 'cfndsl', type: :aruba do
4
6
  let(:usage) do
5
7
  <<-USAGE.gsub(/^ {6}/, '').chomp
@@ -15,7 +17,8 @@ describe 'cfndsl', type: :aruba do
15
17
  -b, --disable-binding Disable binding configuration
16
18
  -m, --disable-deep-merge Disable deep merging of yaml
17
19
  -s, --specification-file FILE Location of Cloudformation Resource Specification file
18
- -u, --update-specification Update the Cloudformation Resource Specification file
20
+ -u [VERSION], Update the Resource Specification file to latest, or specific version
21
+ --update-specification
19
22
  -g RESOURCE_TYPE,RESOURCE_LOGICAL_NAME,
20
23
  --generate Add resource type and logical name
21
24
  -a, --assetversion Print out the specification version
@@ -34,9 +37,9 @@ describe 'cfndsl', type: :aruba do
34
37
 
35
38
  before(:each) { write_file('template.rb', template_content) }
36
39
 
37
- context 'cfndsl -u' do
40
+ context "cfndsl -u #{WORKING_SPEC_VERSION}" do
38
41
  it 'updates the specification file' do
39
- run 'cfndsl -u'
42
+ run_command "cfndsl -u #{WORKING_SPEC_VERSION}"
40
43
  expect(last_command_started).to have_output_on_stderr(<<-OUTPUT.gsub(/^ {8}/, '').chomp)
41
44
  Updating specification file
42
45
  Specification successfully written to #{ENV['HOME']}/.cfndsl/resource_specification.json
@@ -47,7 +50,7 @@ describe 'cfndsl', type: :aruba do
47
50
 
48
51
  context 'cfndsl -a' do
49
52
  it 'prints out the specification file version' do
50
- run 'cfndsl -a'
53
+ run_command 'cfndsl -a'
51
54
  expect(last_command_started).to have_output_on_stderr(/([0-9]+\.){2}[0-9]+/)
52
55
  expect(last_command_started).to have_exit_status(0)
53
56
  end
@@ -55,7 +58,7 @@ describe 'cfndsl', type: :aruba do
55
58
 
56
59
  context 'cfndsl' do
57
60
  it 'displays the usage' do
58
- run 'cfndsl'
61
+ run_command 'cfndsl'
59
62
  expect(last_command_started).to have_output(usage)
60
63
  expect(last_command_started).to have_exit_status(1)
61
64
  end
@@ -63,14 +66,14 @@ describe 'cfndsl', type: :aruba do
63
66
 
64
67
  context 'cfndsl --help' do
65
68
  it 'displays the usage' do
66
- run_simple 'cfndsl --help'
69
+ run_command_and_stop 'cfndsl --help'
67
70
  expect(last_command_started).to have_output(usage)
68
71
  end
69
72
  end
70
73
 
71
74
  context 'cfndsl FILE' do
72
75
  it 'gives a deprecation warning about bindings' do
73
- run_simple 'cfndsl template.rb'
76
+ run_command_and_stop 'cfndsl template.rb'
74
77
  expect(last_command_started).to have_output_on_stderr(<<-WARN.gsub(/^ {8}/, '').chomp)
75
78
  The creation of constants as config is deprecated!
76
79
  Please switch to the #external_parameters method within your templates to access variables
@@ -80,14 +83,14 @@ describe 'cfndsl', type: :aruba do
80
83
  end
81
84
 
82
85
  it 'generates a JSON CloudFormation template' do
83
- run_simple 'cfndsl template.rb'
86
+ run_command_and_stop 'cfndsl template.rb'
84
87
  expect(last_command_started).to have_output_on_stdout('{"AWSTemplateFormatVersion":"2010-09-09","Description":"default"}')
85
88
  end
86
89
  end
87
90
 
88
91
  context 'cfndsl FILE --pretty' do
89
92
  it 'generates a pretty JSON CloudFormation template' do
90
- run_simple 'cfndsl template.rb --pretty'
93
+ run_command_and_stop 'cfndsl template.rb --pretty'
91
94
  expect(last_command_started).to have_output_on_stdout(<<-OUTPUT.gsub(/^ {8}/, '').chomp)
92
95
  {
93
96
  "AWSTemplateFormatVersion": "2010-09-09",
@@ -99,7 +102,7 @@ describe 'cfndsl', type: :aruba do
99
102
 
100
103
  context 'cfndsl FILE --output FILE' do
101
104
  it 'writes the JSON CloudFormation template to a file' do
102
- run_simple 'cfndsl template.rb --output template.json'
105
+ run_command_and_stop 'cfndsl template.rb --output template.json'
103
106
  expect(read('template.json')).to eq(['{"AWSTemplateFormatVersion":"2010-09-09","Description":"default"}'])
104
107
  end
105
108
  end
@@ -108,7 +111,7 @@ describe 'cfndsl', type: :aruba do
108
111
  before { write_file('params.yaml', 'DESC: yaml') }
109
112
 
110
113
  it 'interpolates the YAML file in the CloudFormation template' do
111
- run_simple 'cfndsl template.rb --yaml params.yaml'
114
+ run_command_and_stop 'cfndsl template.rb --yaml params.yaml'
112
115
  expect(last_command_started).to have_output_on_stdout('{"AWSTemplateFormatVersion":"2010-09-09","Description":"yaml"}')
113
116
  end
114
117
  end
@@ -117,7 +120,7 @@ describe 'cfndsl', type: :aruba do
117
120
  before { write_file('params.json', '{"DESC":"json"}') }
118
121
 
119
122
  it 'interpolates the JSON file in the CloudFormation template' do
120
- run_simple 'cfndsl template.rb --json params.json'
123
+ run_command_and_stop 'cfndsl template.rb --json params.json'
121
124
  expect(last_command_started).to have_output_on_stdout('{"AWSTemplateFormatVersion":"2010-09-09","Description":"json"}')
122
125
  end
123
126
  end
@@ -135,12 +138,12 @@ describe 'cfndsl', type: :aruba do
135
138
  before(:each) { write_file('params.rb', 'DESC = "ruby"') }
136
139
 
137
140
  it 'interpolates the Ruby file in the CloudFormation template' do
138
- run_simple 'cfndsl template.rb --ruby params.rb'
141
+ run_command_and_stop 'cfndsl template.rb --ruby params.rb'
139
142
  expect(last_command_started).to have_output_on_stdout('{"AWSTemplateFormatVersion":"2010-09-09","Description":"ruby"}')
140
143
  end
141
144
 
142
145
  it 'gives a deprecation warning and does not interpolate if bindings are disabled' do
143
- run_simple 'cfndsl template.rb --ruby params.rb --disable-binding --verbose'
146
+ run_command_and_stop 'cfndsl template.rb --ruby params.rb --disable-binding --verbose'
144
147
  deprecation_warning = /Interpreting Ruby files was disabled\. .*params.rb will not be read/
145
148
  expect(last_command_started).to have_output_on_stderr(deprecation_warning)
146
149
  expect(last_command_started).to have_output_on_stdout('{"AWSTemplateFormatVersion":"2010-09-09","Description":"default"}')
@@ -149,7 +152,7 @@ describe 'cfndsl', type: :aruba do
149
152
 
150
153
  context 'cfndsl FILE --define VARIABLE=VALUE' do
151
154
  it 'interpolates the command line variables in the CloudFormation template' do
152
- run "cfndsl template.rb --define \"DESC='cli'\""
155
+ run_command "cfndsl template.rb --define \"DESC='cli'\""
153
156
  expect(last_command_started).to have_output_on_stdout("{\"AWSTemplateFormatVersion\":\"2010-09-09\",\"Description\":\"'cli'\"}")
154
157
  end
155
158
  end
@@ -158,7 +161,7 @@ describe 'cfndsl', type: :aruba do
158
161
  before { write_file('params.yaml', 'DESC: yaml') }
159
162
 
160
163
  it 'displays the variables as they are interpolated in the CloudFormation template' do
161
- run_simple 'cfndsl template.rb --yaml params.yaml --verbose'
164
+ run_command_and_stop 'cfndsl template.rb --yaml params.yaml --verbose'
162
165
  verbose = /
163
166
  Using \s specification \s file .* \.json \n
164
167
  Loading \s YAML \s file \s .* params\.yaml \n
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.9
4
+ version: 0.16.10
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: 2018-12-07 00:00:00.000000000 Z
14
+ date: 2019-02-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: bundler
@@ -150,8 +150,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.7.8
153
+ rubygems_version: 3.0.2
155
154
  signing_key:
156
155
  specification_version: 4
157
156
  summary: AWS Cloudformation DSL