Sha256: 2d32b55d4a4750e3055c64c3d483aee3053b61f9c12bf9a670e28126e1619807

Contents?: true

Size: 818 Bytes

Versions: 4

Compression:

Stored size: 818 Bytes

Contents

module Lono::Cfn
  class Cancel < Base
    def run
      stack = find_stack(@stack_name)
      unless stack
        logger.info "The '#{@stack_name}' stack does not exist. Unable to cancel"
        quit 1
      end

      logger.info "Canceling updates to #{@stack_name}."
      logger.info "Current stack status: #{stack.stack_status}"
      if stack.stack_status == "CREATE_IN_PROGRESS"
        cfn.delete_stack(stack_name: @stack_name)
        logger.info "Canceling stack creation."
      elsif stack.stack_status == "UPDATE_IN_PROGRESS"
        cfn.cancel_update_stack(stack_name: @stack_name)
        logger.info "Canceling stack update."
        status.wait if @options[:wait]
      else
        logger.info "The stack is not in a state to that is cancelable: #{stack.stack_status}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc6 lib/lono/cfn/cancel.rb
lono-8.0.0.pre.rc5 lib/lono/cfn/cancel.rb
lono-8.0.0.pre.rc4 lib/lono/cfn/cancel.rb
lono-8.0.0.pre.rc3 lib/lono/cfn/cancel.rb