cfer 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ae5ab57f6fdd11f9af14dafcdb69d2861ce81072
4
- data.tar.gz: 48e6b9fb7c2610fea62f860824fef7261492f32a
3
+ metadata.gz: 961dee72c1a9265e73effbc45cd013160829858e
4
+ data.tar.gz: f09eb22eb304921bb05542bd8575c926be330180
5
5
  SHA512:
6
- metadata.gz: 168f223572bc2a3ba2da53efffc86750e7c17de8012a2d4748f474c6f58db65bbb4bb3769bfe9fffa2c0dd34c72118e697ec54be633c90e3fb616e0885c852a6
7
- data.tar.gz: 88201d52ad6fa62f1c8655c001f94ed5544bc4ead871d14f732043f0ea3fbadedafd8055e4b9f729025a12010aee30e0cd04f050db452ac116d77f0be3341a95
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
 
@@ -44,7 +44,8 @@ module Cfer::Cfn
44
44
  end
45
45
 
46
46
  def estimate(stack, options = {})
47
- response = validate_template(template_body: stack.to_cfn)
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(template_body: stack.to_cfn, parameters: estimate_params)
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
- response = validate_template(template_body: stack.to_cfn)
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! upload_or_return_template(stack.to_cfn, options)
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
- if cfn_hash.bytesize <= 51200 && !options[:force_s3]
272
- { template_body: cfn_hash }
273
- else
274
- raise Cfer::Util::CferError, 'Cfer needs to upload the template to S3, but no bucket was specified.' unless options[:s3_path]
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
- uri = URI(options[:s3_path])
277
- template = Aws::S3::Object.new bucket_name: uri.host, key: uri.path.reverse.chomp('/').reverse
278
- template.put body: cfn_hash
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
- template_url = template.public_url
281
- template_url = template_url + '?versionId=' + template.version_id if template.version_id
284
+ template_url = template.public_url
285
+ template_url = template_url + '?versionId=' + template.version_id if template.version_id
282
286
 
283
- { template_url: template_url }
284
- end
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
@@ -1,5 +1,5 @@
1
1
  module Cfer
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
 
4
4
  begin
5
5
  require 'semantic'
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.1
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-04-20 00:00:00.000000000 Z
11
+ date: 2016-05-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: docile