Class: RubyTerraform::Commands::Untaint
- Includes:
- Options::Global
- Defined in:
- lib/ruby_terraform/commands/untaint.rb
Overview
Wraps the terraform untaint command which removes the ‘tainted’ state from a resource instance.
Terraform uses the term “tainted” to describe a resource instance which may not be fully functional, either because its creation partially failed or because you’ve manually marked it as such using the Taint command.
This command removes that state from a resource instance, causing Terraform to see it as fully-functional and not in need of replacement.
This will not modify your infrastructure directly. It only avoids Terraform planning to replace a tainted instance in a future operation.
For options accepted on construction, see Base#initialize.
When executing an instance of Untaint via Base#execute, the following options are supported:
-
:name
: the name of the resource instance to untaint; required. -
:chdir
: the path of a working directory to switch to before executing the given subcommand. -
:allow_missing
: iftrue
, the command will succeed (i.e., will not throw an Errors::ExecutionError) even if the resource is missing; defaults tofalse
. -
:backup
: the path to backup the existing state file before modifying; defaults to the:state_out
path with “.backup” extension; set:no_backup
totrue
to skip backups entirely. -
:lock
: whentrue
, locks the state file when locking is supported; whenfalse
, does not lock the state file; defaults totrue
. -
:lock_timeout
: the duration to retry a state lock; defaults to “0s”. -
:no_backup
: whentrue
, no backup file will be written; defaults tofalse
. -
:no_color
: whether or not the output from the command should be in color; defaults tofalse
. -
:state
: the path to the state file from which to read state and in which to store state (unless:state_out
is specified); defaults to “terraform.tfstate”. -
:state_out
: the path to write state to that is different than:state
; this can be used to preserve the old state. -
:ignore_remote_version
: whether or not to continue even if remote and local Terraform versions are incompatible; this may result in an unusable workspace, and should be used with extreme caution; defaults tofalse
.
The Base#execute method accepts an optional second parameter which is a map of invocation options. Currently, the only supported option is :environment
which is a map of environment variables to expose during invocation of the command.
Constructor Details
This class inherits a constructor from RubyTerraform::Commands::Base