Sha256: 74bb31a323c2ffd0da358170ad715d4767accbaad0720602b28f9f73fe1dc4e8

Contents?: true

Size: 674 Bytes

Versions: 20

Compression:

Stored size: 674 Bytes

Contents

module Cody
  class Delete
    include AwsServices

    def initialize(options)
      @options = options
      @project_name = options[:project_name] || inferred_project_name
      @stack_name = options[:stack_name] || inferred_stack_name(@project_name)
    end

    def run
      message = "Deleted #{@stack_name} stack."
      if @options[:noop]
        puts "NOOP #{message}"
      else
        are_you_sure?(@stack_name, :delete)

        if stack_exists?(@stack_name)
          cfn.delete_stack(stack_name: @stack_name)
          puts message
        else
          puts "#{@stack_name.inspect} stack does not exist".color(:red)
        end
      end
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
cody-0.9.8 lib/cody/delete.rb
cody-0.9.7 lib/cody/delete.rb
cody-0.9.6 lib/cody/delete.rb
cody-0.9.5 lib/cody/delete.rb
cody-0.9.4 lib/cody/delete.rb
cody-0.9.3 lib/cody/delete.rb
cody-0.9.2 lib/cody/delete.rb
cody-0.9.1 lib/cody/delete.rb
cody-0.9.0 lib/cody/delete.rb
cody-0.8.6 lib/cody/delete.rb
cody-0.8.5 lib/cody/delete.rb
cody-0.8.4 lib/cody/delete.rb
cody-0.8.3 lib/cody/delete.rb
cody-0.8.2 lib/cody/delete.rb
cody-0.8.1 lib/cody/delete.rb
cody-0.8.0 lib/cody/delete.rb
cody-0.7.3 lib/cody/delete.rb
cody-0.7.2 lib/cody/delete.rb
cody-0.7.1 lib/cody/delete.rb
cody-0.7.0 lib/cody/delete.rb