Sha256: fe146e76be1349c344b217621a302963eb53976557d63cbbd853dc8c735e786d

Contents?: true

Size: 721 Bytes

Versions: 12

Compression:

Stored size: 721 Bytes

Contents

module Ufo
  class Cancel < Base
    def run
      stack = find_stack(@stack_name)
      unless stack
        puts "No #{@service} service to cancel."
        puts "No #{@stack_name} stack to cancel. Exiting"
        exit
      end

      puts "Canceling updates to #{@stack_name}."
      if stack.stack_status == "CREATE_IN_PROGRESS"
        cloudformation.delete_stack(stack_name: @stack_name)
        puts "Canceling stack creation."
      elsif stack.stack_status =~ /_IN_PROGRESS$/
        cloudformation.cancel_update_stack(stack_name: @stack_name)
        puts "Canceling stack update."
      else
        puts "The stack is not in a state to that is cancelable: #{stack.stack_status}"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ufo-4.5.7 lib/ufo/cancel.rb
ufo-4.5.6 lib/ufo/cancel.rb
ufo-4.5.5 lib/ufo/cancel.rb
ufo-4.5.4 lib/ufo/cancel.rb
ufo-4.5.3 lib/ufo/cancel.rb
ufo-4.5.2 lib/ufo/cancel.rb
ufo-4.5.1 lib/ufo/cancel.rb
ufo-4.5.0 lib/ufo/cancel.rb
ufo-4.4.3 lib/ufo/cancel.rb
ufo-4.4.2 lib/ufo/cancel.rb
ufo-4.4.1 lib/ufo/cancel.rb
ufo-4.4.0 lib/ufo/cancel.rb