stackup 1.4.6 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/README.md +5 -1
- data/bin/stackup +10 -0
- data/lib/stackup/change_set.rb +3 -0
- data/lib/stackup/stack.rb +3 -0
- data/lib/stackup/version.rb +1 -1
- data/spec/stackup/rake_tasks_spec.rb +3 -3
- data/spec/stackup/stack_spec.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: c15ca8477932ab203176cf7047ba309edae07fe35c36cdf797353d747bb74e5b
|
4
|
+
data.tar.gz: 195ebfa65f7fa5a3836abf59e855fe803f97e1dbc28965800f89c88f5b56a22d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8439adf18ef0d019ea73e2205b9c0d33848f2151c48ef45e5b6f8552492d860bf0ad9477d625d62163537da997fc18c763310731a4f8735860e6edc4cf121b91
|
7
|
+
data.tar.gz: 8022894472208a085f0224c71e2e2bbfb9d896673c6fbd5a5af259c970383c8edec14cba14cc5cc576e8d203a15e1121bb682321ab5c79a224b3a6ac52ceb996
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# CHANGES
|
2
2
|
|
3
|
+
## 1.5.0 (2020-04-21)
|
4
|
+
|
5
|
+
* Feature: --preserve-template-formatting
|
6
|
+
|
7
|
+
## 1.4.6 (2019-12-09)
|
8
|
+
|
9
|
+
* Fix: Don't error out when receiving tags in AWS style (array of hashes) from YAML or JSON file
|
10
|
+
|
3
11
|
## 1.4.5 (2019-10-03)
|
4
12
|
|
5
13
|
* Fix: Tags in RakeTasks
|
data/README.md
CHANGED
@@ -155,7 +155,11 @@ This is to provide backwards compatibility with previously deployed stacks and m
|
|
155
155
|
|
156
156
|
`stackup` supports input files (template, parameters, tags) in YAML format, as well as JSON.
|
157
157
|
|
158
|
-
It also supports the [abbreviated YAML syntax for Cloudformation functions](https://aws.amazon.com/blogs/aws/aws-cloudformation-update-yaml-cross-stack-references-simplified-substitution/), though unlike the [AWS CLI](https://aws.amazon.com/cli/), Stackup normalises YAML input to JSON before invoking CloudFormation APIs.
|
158
|
+
It also supports the [abbreviated YAML syntax for Cloudformation functions](https://aws.amazon.com/blogs/aws/aws-cloudformation-update-yaml-cross-stack-references-simplified-substitution/), though unlike the [AWS CLI](https://aws.amazon.com/cli/), Stackup (by default) normalises YAML input to JSON before invoking CloudFormation APIs.
|
159
|
+
|
160
|
+
If you don't want normalisation of the YAML input to JSON, then use the `--preserve-template-formatting` flag to the `up` or `change-set create` commands.
|
161
|
+
|
162
|
+
Note: normalisation of S3 / HTTP URL stored templates is never done, as Cloudformation collects these directly.
|
159
163
|
|
160
164
|
### AWS credentials
|
161
165
|
|
data/bin/stackup
CHANGED
@@ -181,6 +181,9 @@ Clamp do
|
|
181
181
|
option ["-T", "--use-previous-template"], :flag,
|
182
182
|
"reuse the existing template"
|
183
183
|
|
184
|
+
option ["-P", "--preserve-template-formatting"], :flag,
|
185
|
+
"do not normalise the template when calling the Cloudformation APIs; useful for preserving YAML and comments"
|
186
|
+
|
184
187
|
include HasParameters
|
185
188
|
|
186
189
|
option "--tags", "FILE", "stack tags file",
|
@@ -214,6 +217,7 @@ Clamp do
|
|
214
217
|
options[:template_url] = template_source.location
|
215
218
|
else
|
216
219
|
options[:template] = template_source.data
|
220
|
+
options[:template_orig] = template_source.body
|
217
221
|
end
|
218
222
|
end
|
219
223
|
options[:on_failure] = on_failure
|
@@ -229,6 +233,7 @@ Clamp do
|
|
229
233
|
options[:role_arn] = service_role_arn if service_role_arn
|
230
234
|
options[:use_previous_template] = use_previous_template?
|
231
235
|
options[:capabilities] = capability_list
|
236
|
+
options[:preserve] = preserve_template_formatting?
|
232
237
|
report_change do
|
233
238
|
stack.create_or_update(options)
|
234
239
|
end
|
@@ -274,6 +279,9 @@ Clamp do
|
|
274
279
|
option ["-T", "--use-previous-template"], :flag,
|
275
280
|
"reuse the existing template"
|
276
281
|
|
282
|
+
option ["-P", "--preserve-template-formatting"], :flag,
|
283
|
+
"do not normalise the template when calling the Cloudformation APIs; useful for preserving YAML and comments"
|
284
|
+
|
277
285
|
option ["--force"], :flag,
|
278
286
|
"replace existing change-set of the same name"
|
279
287
|
|
@@ -296,6 +304,7 @@ Clamp do
|
|
296
304
|
options[:template_url] = template_source.location
|
297
305
|
else
|
298
306
|
options[:template] = template_source.data
|
307
|
+
options[:template_orig] = template_source.body
|
299
308
|
end
|
300
309
|
end
|
301
310
|
options[:parameters] = parameters
|
@@ -304,6 +313,7 @@ Clamp do
|
|
304
313
|
options[:use_previous_template] = use_previous_template?
|
305
314
|
options[:force] = force?
|
306
315
|
options[:capabilities] = capability_list
|
316
|
+
options[:preserve] = preserve_template_formatting?
|
307
317
|
report_change do
|
308
318
|
change_set.create(options)
|
309
319
|
end
|
data/lib/stackup/change_set.rb
CHANGED
@@ -57,6 +57,9 @@ module Stackup
|
|
57
57
|
options[:change_set_type] = stack.exists? ? "UPDATE" : "CREATE"
|
58
58
|
force = options.delete(:force)
|
59
59
|
options[:template_body] = MultiJson.dump(options.delete(:template)) if options[:template]
|
60
|
+
# optionally override template_body with the original template to preserve formatting (& comments in YAML)
|
61
|
+
template_orig = options.delete(:template_orig)
|
62
|
+
options[:template_body] = template_orig if options.delete(:preserve)
|
60
63
|
options[:parameters] = Parameters.new(options[:parameters]).to_a if options[:parameters]
|
61
64
|
options[:tags] = normalize_tags(options[:tags]) if options[:tags]
|
62
65
|
options[:capabilities] ||= ["CAPABILITY_NAMED_IAM"]
|
data/lib/stackup/stack.rb
CHANGED
@@ -119,6 +119,9 @@ module Stackup
|
|
119
119
|
if (template_data = options.delete(:template))
|
120
120
|
options[:template_body] = MultiJson.dump(template_data)
|
121
121
|
end
|
122
|
+
# optionally override template_body with the original template to preserve formatting (& comments in YAML)
|
123
|
+
template_orig = options.delete(:template_orig)
|
124
|
+
options[:template_body] = template_orig if options.delete(:preserve)
|
122
125
|
if (parameters = options[:parameters])
|
123
126
|
options[:parameters] = Parameters.new(parameters).to_a
|
124
127
|
end
|
data/lib/stackup/version.rb
CHANGED
data/spec/stackup/stack_spec.rb
CHANGED
@@ -270,7 +270,7 @@ describe Stackup::Stack do
|
|
270
270
|
|
271
271
|
it "converts them to an Array, that uses symbols as keys" do
|
272
272
|
expected_tags = [
|
273
|
-
{ :key => "foo", :value => "bar" }
|
273
|
+
{ :key => "foo", :value => "bar" }
|
274
274
|
]
|
275
275
|
create_or_update
|
276
276
|
expect(cf_client).to have_received(:create_stack) do |options|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stackup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Williams
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: aws-sdk-cloudformation
|