stackit 0.1.9 → 0.1.10

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: 33bad9d7a59c02a98816dcd1b5d66f3bdf1f926f
4
- data.tar.gz: bdc19bd454463d43451b9814d5577988281d7aed
3
+ metadata.gz: 90de8c84a5d299ad1445243615e535ff5f416d71
4
+ data.tar.gz: 673a139a05083ee84278ad0888a403c316b301a8
5
5
  SHA512:
6
- metadata.gz: c079aa965096fc179aac39e373f9db79e348284d3bf201884c89514696f2c710ac452e9f948db936da2dcccb78f88707739190c5bbd560b476a177b6a1636b5b
7
- data.tar.gz: 9bbe58a0e50948d4676e7870963ea606c0a62ba92726291738aa42e3cd723980cf869c029afb011f1aa7286613410449095175a5f940861ef489ce662eb91b0b
6
+ metadata.gz: 28ab5be9436da8060bfb9a33a62df8092dc12a1b9fe3df358e6dd458a157d76ff113b942dc69c926a6e5a8de42ea0f4432f56457847fdbc02302bb5ea12b26f7
7
+ data.tar.gz: 70eac4c9d33238d207b93676c283bad608bd6b0f91f298bf89ddc02175bb6b936e987de64eff9df68da0a77ed52d9a6df2a13950f2aed5dbe10c41a883500653
data/README.md CHANGED
@@ -52,7 +52,7 @@ Your stack can `--depend` on existing stacks. Any resource, output, or parameter
52
52
 
53
53
  User defined parameters allow you to define the parameters yourself using the `--parameters` option.
54
54
 
55
- > User defined parameters override file parameters.
55
+ > User defined parameters override both file parameters and `--depends` parameters.
56
56
 
57
57
  ## Usage
58
58
 
@@ -63,26 +63,26 @@ StackIT ships with [Thor](http://whatisthor.com/) to provide a command line inte
63
63
  # show top level commands
64
64
  stackit help
65
65
 
66
- # show options for create command
67
- stackit help create
66
+ # show options for create-stack command
67
+ stackit help create-stack
68
68
 
69
- ##### Create a stack using a parameter file
69
+ ###### Create a stack using a parameter file
70
70
 
71
71
  stackit create-stack --stack-name mystack --template mytemplate.json --parameter-file mytemplate.parameters
72
72
 
73
- ##### Create a stack using `--depends` to reference resource, output and parameter values in the "myvpc" stack
73
+ ###### Create a stack using `--depends` to reference resource, output and parameter values in the "myvpc" stack
74
74
 
75
75
  stackit create-stack --stack-name mystack --template mytemplate.json --depends myvpc
76
76
 
77
- ##### Create a stack using user defined parameters
77
+ ###### Create a stack using user defined parameters
78
78
 
79
79
  stackit create-stack --stack-name mystack --template mytemplate.json --parameters param1:value1 param2:value2
80
80
 
81
- ##### Create a stack using a parameter file, overriding parameters found in the "myvpc" resource, output or parameters.
81
+ ###### Create a stack using a parameter file, overriding parameters found in the "myvpc" resource, output or parameters.
82
82
 
83
83
  stackit create-stack --stack-name mystack --template mytemplate.json --parameter-file mytemplate.parameters --depends myvpc
84
84
 
85
- ##### Create a stack using a parameter file, overriding those parameters with mapped parameters in the "myvpc" stack, and override both of those with user defined parameters.
85
+ ###### Create a stack using a parameter file, overriding those parameters with mapped parameters in the "myvpc" stack, and override both of those with user defined parameters.
86
86
 
87
87
  stackit create-stack --stack-name mystack --template mytemplate.json --parameter-file mytemplate.parameters --depends myvpc --parameters param1:final_value
88
88
 
@@ -2,6 +2,7 @@ module Stackit
2
2
  class ManagedStack < Stack
3
3
 
4
4
  attr_accessor :template
5
+ attr_accessor :template_path
5
6
  attr_accessor :file_parameters
6
7
  attr_accessor :user_defined_parameters
7
8
  attr_accessor :parameter_map
@@ -14,7 +15,7 @@ module Stackit
14
15
 
15
16
  def initialize(options={})
16
17
  super(options)
17
- self.template = create_template(options[:template])
18
+ self.template_path = options[:template]
18
19
  self.user_defined_parameters = symbolized_user_defined_parameters(options[:user_defined_parameters])
19
20
  self.parameter_map = symbolized_parameter_map(options[:parameter_map])
20
21
  self.stack_name = options[:stack_name] || default_stack_name
@@ -160,8 +161,9 @@ module Stackit
160
161
  self.class.name.demodulize
161
162
  end
162
163
 
163
- def create_template(t)
164
+ def create_template(t, action)
164
165
  template_path = t ? t : File.join(Dir.pwd, 'cloudformation', "#{stack_name.underscore.dasherize}.json")
166
+ raise "Unable to locate template: #{template_path}" unless (template.nil? && action == :delete_stack)
165
167
  return unless File.exist?(template_path)
166
168
  template = Template.new(
167
169
  :cloudformation => cloudformation,
@@ -210,6 +212,7 @@ module Stackit
210
212
 
211
213
  def cloudformation_request(action)
212
214
  Stackit.logger.debug "ManagedStack CloudFormation API request: #{action}"
215
+ self.template = create_template(template_path, action);
213
216
  cloudformation_options = create_cloudformation_options(action)
214
217
  if debug
215
218
  Stackit.logger.debug "#{action} request parameters: "
@@ -1,3 +1,3 @@
1
1
  module Stackit
2
- VERSION = "0.1.9"
2
+ VERSION = "0.1.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stackit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Hahn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-04-22 00:00:00.000000000 Z
11
+ date: 2016-04-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler