class RubyTerraform::Commands::ForceUnlock
Wraps the +terraform force-unlock+ command which manually unlocks the state for the defined configuration.
This will not modify your infrastructure. This command removes the lock on the state for the current workspace. The behavior of this lock is dependent on the backend being used. Local state files cannot be unlocked by another process.
For options accepted on construction, see {#initialize}.
When executing an instance of {ForceUnlock} via {#execute}, the following options are supported:
-
:lock_id
: the lock ID output when attempting an operation that failed due to a lock; required. -
:directory
: the path to a directory containing terraform configuration (deprecated in terraform 0.14, removed in terraform 0.15, use:chdir
instead). -
:chdir
: the path of a working directory to switch to before executing the given subcommand. -
:force
: Iftrue
, does not ask for input for unlock confirmation; defaults tofalse
.
@example Basic Invocation
RubyTerraform::Commands::ForceUnlock.new.execute( lock_id: '50e844a7-ebb0-fcfd-da85-5cce5bd1ec90')
Public Instance Methods
@!visibility private
# File lib/ruby_terraform/commands/force_unlock.rb, line 49 def arguments(parameters) [parameters[:lock_id], parameters[:directory]] end
@!visibility private
RubyTerraform::Options::Global#options
# File lib/ruby_terraform/commands/force_unlock.rb, line 44 def options %w[-force] + super end
@!visibility private
# File lib/ruby_terraform/commands/force_unlock.rb, line 39 def subcommands %w[force-unlock] end