Class: RubyTerraform::Commands::StateReplaceProvider
- Includes:
- Options::Global
- Defined in:
- lib/ruby_terraform/commands/state_replace_provider.rb
Overview
Wraps the terraform state replace-provider command which replaces provider for resources in the Terraform state.
For options accepted on construction, see Base#initialize.
When executing an instance of StateReplaceProvider via Base#execute, the following options are supported:
-
:from
: the fully qualified name of the provider to be replaced; required. -
:to
: the fully qualified name of the provider to replace with; required. -
:chdir
: the path of a working directory to switch to before executing the given subcommand. -
:auto_approve
: iftrue
, skips interactive approval; defaults tofalse
. -
:backup
: the path where Terraform should write the backup for the
state file; this can’t be disabled; if not set, Terraform will write it to the same path as the state file with a “.backup” extension.
-
: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”. -
:state
: the path to the state file to update; defaults to the current workspace 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