cfer 0.4.1 → 0.4.2
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/README.md +1 -0
- data/lib/cfer/cfn/client.rb +19 -15
- data/lib/cfer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 961dee72c1a9265e73effbc45cd013160829858e
|
4
|
+
data.tar.gz: f09eb22eb304921bb05542bd8575c926be330180
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95e6cb1e1b177516356a98f87ff3cd54b46e95668cf156ddd54f8ef22d22c0b7130905b1c7665473ad8f06d8dee175464eed4f9937dc6f469f06e94d50064b8d
|
7
|
+
data.tar.gz: 66a4ec1bdcaa018295aa95ca8cde3fba47c95951015ab38c1261a8c4708cdb2766c543ba05e65acae1c3e9b1ed4458def6bc4e241075ed7b8674f5234fb8168a
|
data/README.md
CHANGED
@@ -313,6 +313,7 @@ This project also contains a [Code of Conduct](https://github.com/seanedwards/cf
|
|
313
313
|
* Stores Cfer version and Git repo information in the Repo metadata.
|
314
314
|
* Added support for uploading templates to S3 with the `--s3-path` and `--force-s3` options.
|
315
315
|
* Added new way of extending resources, making plugins easier.
|
316
|
+
* Added support for [CloudFormation Change Sets](https://aws.amazon.com/blogs/aws/new-change-sets-for-aws-cloudformation/) via the `--change` option.
|
316
317
|
|
317
318
|
### Bugfixes
|
318
319
|
|
data/lib/cfer/cfn/client.rb
CHANGED
@@ -44,7 +44,8 @@ module Cfer::Cfn
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def estimate(stack, options = {})
|
47
|
-
|
47
|
+
estimate_options = upload_or_return_template(stack.to_cfn, options)
|
48
|
+
response = validate_template(estimate_options)
|
48
49
|
|
49
50
|
estimate_params = []
|
50
51
|
response.parameters.each do |tmpl_param|
|
@@ -62,7 +63,7 @@ module Cfer::Cfn
|
|
62
63
|
end
|
63
64
|
end
|
64
65
|
|
65
|
-
estimate_response = estimate_template_cost(
|
66
|
+
estimate_response = estimate_template_cost(estimate_options.merge(parameters: estimate_params))
|
66
67
|
estimate_response.url
|
67
68
|
end
|
68
69
|
|
@@ -70,7 +71,9 @@ module Cfer::Cfn
|
|
70
71
|
Preconditions.check(@name).is_not_nil
|
71
72
|
Preconditions.check(stack) { is_not_nil and has_type(Cfer::Core::Stack) }
|
72
73
|
|
73
|
-
|
74
|
+
template_options = upload_or_return_template(stack.to_cfn, options)
|
75
|
+
|
76
|
+
response = validate_template(template_options)
|
74
77
|
|
75
78
|
create_params = []
|
76
79
|
update_params = []
|
@@ -131,7 +134,7 @@ module Cfer::Cfn
|
|
131
134
|
stack_options.merge! parse_stack_policy(:stack_policy, options[:stack_policy])
|
132
135
|
stack_options.merge! parse_stack_policy(:stack_policy_during_update, options[:stack_policy_during_update])
|
133
136
|
|
134
|
-
stack_options.merge!
|
137
|
+
stack_options.merge! template_options
|
135
138
|
|
136
139
|
cfn_stack =
|
137
140
|
begin
|
@@ -268,20 +271,21 @@ module Cfer::Cfn
|
|
268
271
|
private
|
269
272
|
|
270
273
|
def upload_or_return_template(cfn_hash, options = {})
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
274
|
+
@template_options ||=
|
275
|
+
if cfn_hash.bytesize <= 51200 && !options[:force_s3]
|
276
|
+
{ template_body: cfn_hash }
|
277
|
+
else
|
278
|
+
raise Cfer::Util::CferError, 'Cfer needs to upload the template to S3, but no bucket was specified.' unless options[:s3_path]
|
275
279
|
|
276
|
-
|
277
|
-
|
278
|
-
|
280
|
+
uri = URI(options[:s3_path])
|
281
|
+
template = Aws::S3::Object.new bucket_name: uri.host, key: uri.path.reverse.chomp('/').reverse
|
282
|
+
template.put body: cfn_hash
|
279
283
|
|
280
|
-
|
281
|
-
|
284
|
+
template_url = template.public_url
|
285
|
+
template_url = template_url + '?versionId=' + template.version_id if template.version_id
|
282
286
|
|
283
|
-
|
284
|
-
|
287
|
+
{ template_url: template_url }
|
288
|
+
end
|
285
289
|
end
|
286
290
|
|
287
291
|
def cfn_list_to_hash(attribute, list)
|
data/lib/cfer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Edwards
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: docile
|