Improve documentation around static evaluation (#1843)

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: ollevche <ollevche@gmail.com>
Co-authored-by: ollevche <ollevche@gmail.com>
This commit is contained in:
Christian Mesh
2024-07-23 09:31:50 -04:00
committed by GitHub
parent 89926cc97a
commit 3b3822d770
31 changed files with 640 additions and 12 deletions

View File

@@ -21,6 +21,14 @@ This command will output a backup copy of the state prior to saving any
changes. The backup cannot be disabled. Due to the destructive nature
of this command, backups are required.
:::note
Use of variables in [module sources](../../../language/modules/sources.mdx#support-for-variable-and-local-evaluation),
[backend configuration](../../../language/settings/backends/configuration.mdx#variables-and-locals),
or [encryption block](../../../language/state/encryption.mdx#configuration)
requires [assigning values to root module variables](../../../language/values/variables.mdx#assigning-values-to-root-module-variables)
when running `tofu state replace-providers`.
:::
This command also accepts the following options:
- `-auto-approve` - Skip interactive approval.
@@ -31,6 +39,22 @@ This command also accepts the following options:
- `-lock-timeout=0s` - Duration to retry a state lock.
- `-var 'NAME=VALUE'` - Sets a value for a single
[input variable](../../../language/values/variables.mdx) declared in the
root module of the configuration. Use this option multiple times to set
more than one variable. Refer to
[Input Variables on the Command Line](../plan.mdx#input-variables-on-the-command-line) for more information.
- `-var-file=FILENAME` - Sets values for potentially many
[input variables](../../../language/values/variables.mdx) declared in the
root module of the configuration, using definitions from a
["tfvars" file](../../../language/values/variables.mdx#variable-definitions-tfvars-files).
Use this option multiple times to include values from more than one file.
There are several other ways to set values for input variables in the root
module, aside from the `-var` and `-var-file` options. Refer to
[Assigning Values to Root Module Variables](../../../language/values/variables.mdx#assigning-values-to-root-module-variables) for more information.
For configurations using the [`cloud` backend](../../../cli/cloud/index.mdx) or the [`remote` backend](../../../language/settings/backends/remote.mdx)
only, `tofu state replace-provider`
also accepts the option