Sha256: 60f0f3618e629d64f733377ee20e8112e90012c21f57c415856a5cea96a094ff
Contents?: true
Size: 1 KB
Versions: 9
Compression:
Stored size: 1 KB
Contents
module Ruby module Terraform module Commands class DestroyCommand include ExecutionSupport attr_accessor :dir attr_accessor :state attr_accessor :vars attr_accessor :auto_approve def initialize(opts = {}) @dir = opts[:dir] @state = opts[:state] @vars = opts[:vars] @auto_approve = if opts[:auto_approve].nil? true else opts[:auto_approve] end end def command cmd = %W[#{tf_binary} destroy] cmd += ['-state', state] if state cmd += ['-auto-approve'] if auto_approve if vars vars.each do |key, value| var_value = value.is_a?(String) ? value : JSON.generate(value) cmd += ['-var', "#{key}=#{var_value}"] end end cmd += [dir] if dir cmd end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems