class RubyTerraform::Commands::StateReplaceProvider
Wraps the +terraform state replace-provider+ command which replaces provider for resources in the Terraform state.
For options accepted on construction, see {#initialize}.
When executing an instance of {StateReplaceProvider} via {#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
.
@example Basic Invocation
RubyTerraform::Commands::StateReplaceProvider.new.execute( from: 'hashicorp/aws', to: 'registry.acme.corp/acme/aws')
Public Instance Methods
@!visibility private
# File lib/ruby_terraform/commands/state_replace_provider.rb, line 63 def arguments(parameters) [parameters[:from], parameters[:to]] end
@!visibility private
RubyTerraform::Options::Global#options
# File lib/ruby_terraform/commands/state_replace_provider.rb, line 51 def options %w[ -auto-approve -backup -lock -lock-timeout -state -ignore-remote-version ] + super end
@!visibility private
# File lib/ruby_terraform/commands/state_replace_provider.rb, line 46 def subcommands %w[state replace-provider] end