Module: Proteus::Commands::Taint

Defined in:
lib/proteus/commands/taint.rb

Class Method Summary collapse

Class Method Details

.included(thor_class) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/proteus/commands/taint.rb', line 4

def self.included(thor_class)
  thor_class.class_eval do

    desc "taint", "Taints an existing resource"
    long_desc <<-LONGDESC
      Taints an existing resource

      --resource The resource to taint
    LONGDESC
    option :resource, type: :string, aliases: "-r", required: true
    def taint
      init(verbose: parent_options[:verbose])
      confirm question: "Do you really want to run 'terraform taint' on environment '#{environment}' in context '#{context}'?", color: :on_red, exit_code: 0 do

        taint_command = <<~TAINT_COMMAND
          cd #{context_path(context)} && \
          terraform taint \
          #{options[:resource]}
        TAINT_COMMAND
        syscall taint_command.squeeze(' ')
      end
    end

  end
end