cloudformation-tool 0.5.5 → 0.5.6

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: 39ae25171377129aada7e6a6d089eb9f081b05bf
4
- data.tar.gz: 153b0821c6888b55c499482fdfd55df83483c906
3
+ metadata.gz: 48f4c2873d720d299c5ab653cd41fa270c1ccf06
4
+ data.tar.gz: a4c58902080508b20d01c39b457a73edc50880a5
5
5
  SHA512:
6
- metadata.gz: 52fc415aa77133a863e0bef3ed0270d64aebb9e796422e622a5c885495c8ebb48cf920eefb9616d8bab3d1028cdc65601f8f4047228b9c0fa180d7d7d8936fde
7
- data.tar.gz: 71e8b1bc34031cf60aaa368485b00316d6e521ae52d688209dc4aa9e577021ee2a0193ea6c2d83798abc69fcc6f9405a23bfa9930c7135a7dcb096a69bd5e123
6
+ metadata.gz: ae305dc7980e6a5d53272a14045c6cc5db3f1e917ec7812d39cd9cc75dffb64aa55ca6ff492f0d26251cd69cc992c4cf6bc5f112fcc241f323a92d9ec36f3369
7
+ data.tar.gz: 6d712ffeb74e9258016b1108532eef0fba4b4be61f8996abcdf13e702c15602a3348619e5317a38008128f4d69914689f6b311cf53d0b72a1d74425676fcfdbc
data/bin/cftool CHANGED
@@ -4,7 +4,7 @@ require 'cloud_formation_tool'
4
4
 
5
5
  begin
6
6
  CloudFormationTool::CLI::Main.run
7
- rescue CloudFormationTool::Errors::AppError => e
7
+ rescue CloudFormationTool::Errors::BaseError => e
8
8
  warn e.message
9
- exit(1)
9
+ exit 1
10
10
  end
@@ -49,20 +49,24 @@ module CloudFormationTool
49
49
  url = upload(make_filename('yaml'), tmpl, gzip: false)
50
50
  return update(url, template, params) if exist?
51
51
  log "Creating stack '#{name}' from '#{template}' params #{params.inspect}"
52
- resp = awscf.create_stack({
53
- stack_name: @name,
54
- template_url: url,
55
- capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM),
56
- on_failure: "DO_NOTHING", ##"ROLLBACK",
57
- parameters: params.collect do |k,v|
58
- {
59
- parameter_key: k.to_s,
60
- parameter_value: v.to_s,
61
- use_previous_value: false,
62
- }
63
- end
64
- })
65
- resp.stack_id
52
+ begin
53
+ resp = awscf.create_stack({
54
+ stack_name: @name,
55
+ template_url: url,
56
+ capabilities: %w(CAPABILITY_IAM CAPABILITY_NAMED_IAM),
57
+ on_failure: "DO_NOTHING", ##"ROLLBACK",
58
+ parameters: params.collect do |k,v|
59
+ {
60
+ parameter_key: k.to_s,
61
+ parameter_value: v.to_s,
62
+ use_previous_value: false,
63
+ }
64
+ end
65
+ })
66
+ resp.stack_id
67
+ rescue Aws::CloudFormation::Errors::ValidationError => e
68
+ raise CloudFormationTool::Errors::ValidationError, "Stack validation error: #{e.message}"
69
+ end
66
70
  end
67
71
 
68
72
  def resources
@@ -2,10 +2,14 @@ module CloudFormationTool
2
2
  module Errors
3
3
 
4
4
  Autoloaded.module { }
5
+
6
+ class BaseError < StandardError; end
5
7
 
6
- class AppError < StandardError; end
8
+ class AppError < BaseError; end
7
9
 
8
- class StackDoesNotExistError < StandardError; end
10
+ class ValidationError < BaseError; end
11
+
12
+ class StackDoesNotExistError < BaseError; end
9
13
 
10
14
  end
11
15
  end
@@ -1,3 +1,3 @@
1
1
  module CloudFormationTool
2
- VERSION = '0.5.5'
2
+ VERSION = '0.5.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudformation-tool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oded Arbel