Method: Ufo::Stack#handle_stack_error

Defined in:
lib/ufo/stack.rb

#handle_stack_error(e) ⇒ Object

Assume only first container_definition to get the container info. Stack:arn:aws:cloudformation:… is in ROLLBACK_COMPLETE state and can not be updated.



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
# File 'lib/ufo/stack.rb', line 185

def handle_stack_error(e)
  case e.message
  when /state and can not be updated/
    puts "The #{@stack_name} stack is in a state that cannot be updated. Deleted the stack and try again."
    puts "ERROR: #{e.message}"
    if message.include?('UPDATE_ROLLBACK_FAILED')
      puts "You might be able to do a 'Continue Update Rollback' and skip some resources to get the stack back into a good state."
    end
    region = `aws configure get region`.strip rescue 'us-east-1'
    url = "https://console.aws.amazon.com/cloudformation/home?region=#{region}"
    puts "Here's the CloudFormation console url: #{url}"
    exit 1
  when /No updates are to be performed/
    puts "There are no updates to be performed. Exiting.".color(:yellow)
    exit 1
  else
    raise
  end
end