Sha256: 471275a00fcdc6cd1d75b9b00655f2f25f174caa28344279351d200773748f2e

Contents?: true

Size: 787 Bytes

Versions: 1

Compression:

Stored size: 787 Bytes

Contents

module Ufo
  class Destroy < Base
    def bye
      unless are_you_sure?
        puts "Phew, that was close"
        return
      end

      stack = find_stack(@stack_name)
      unless stack
        puts "Stack #{@stack_name} does not exist."
        exit
      end

      cloudformation.delete_stack(stack_name: @stack_name)
      puts "Deleting CloudFormation stack with ECS resources: #{@stack_name}."
      return unless @options[:wait]
      status.wait
    end

    def are_you_sure?
      return true if @options[:sure]
      puts "You are about to destroy #{@pretty_service_name.colorize(:green)} service on the #{@cluster.colorize(:green)} cluster."
      print "Are you sure you want to do this? (y/n) "
      answer = $stdin.gets.strip
      answer =~ /^y/
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ufo-4.0.3 lib/ufo/destroy.rb