Sha256: 2e258d5ef0b851c95f4f0ccd0fd48596804951474e96a91b2e351da6daad152b
Contents?: true
Size: 917 Bytes
Versions: 29
Compression:
Stored size: 917 Bytes
Contents
class Lono::Cfn class Delete include Lono::AwsServices include Lono::Utils::Sure def initialize(options={}) @options = options @stack = options.delete(:stack) end def run message = "Deleting #{@stack} stack." if @options[:noop] puts "NOOP #{message}" else sure?("Are you sure you want to delete the #{@stack} stack?") if stack_exists?(@stack) cfn.delete_stack(stack_name: @stack) puts message else puts "#{@stack.inspect} stack does not exist".color(:red) return end end return unless @options[:wait] start_time = Time.now status.wait unless @options[:noop] took = Time.now - start_time puts "Time took for stack deletion: #{status.pretty_time(took).color(:green)}." end def status @status ||= Status.new(@stack) end end end
Version data entries
29 entries across 29 versions & 1 rubygems