Method: Stackup::Stack#create_or_update
- Defined in:
- lib/stackup/stack.rb
#create_or_update(options) ⇒ String Also known as: up
Create or update the stack.
114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 |
# File 'lib/stackup/stack.rb', line 114 def create_or_update() = .dup if (template_data = .delete(:template)) [:template_body] = MultiJson.dump(template_data) end if (parameters = [:parameters]) [:parameters] = Parameters.new(parameters).to_a end if ( = [:tags]) [:tags] = () end if (policy_data = .delete(:stack_policy)) [:stack_policy_body] = MultiJson.dump(policy_data) end if (policy_data = .delete(:stack_policy_during_update)) [:stack_policy_during_update_body] = MultiJson.dump(policy_data) end [:capabilities] ||= ["CAPABILITY_NAMED_IAM"] delete if ALMOST_DEAD_STATUSES.include?(status) update() rescue NoSuchStack create() end |