Sha256: 84b3476ab0e2432cb888990d2d73b3fa90da354045da42e9c0b6c087e7fb1be1
Contents?: true
Size: 1006 Bytes
Versions: 28
Compression:
Stored size: 1006 Bytes
Contents
class Lono::Cfn class Cancel include Lono::AwsServices include Util def initialize(stack_name, options={}) @stack_name = switch_current(stack_name) @options = options end def run stack = find_stack(@stack_name) unless stack puts "The '#{@stack_name}' stack does not exist. Unable to cancel" exit 1 end puts "Canceling updates to #{@stack_name}." puts "Current stack status: #{stack.stack_status}" if stack.stack_status == "CREATE_IN_PROGRESS" cfn.delete_stack(stack_name: @stack_name) puts "Canceling stack creation." elsif stack.stack_status == "UPDATE_IN_PROGRESS" cfn.cancel_update_stack(stack_name: @stack_name) puts "Canceling stack update." status.wait if @options[:wait] else puts "The stack is not in a state to that is cancelable: #{stack.stack_status}" end end def status @status ||= Status.new(@stack_name) end end end
Version data entries
28 entries across 28 versions & 1 rubygems