cli+website: -ignore-remote-version docs and other cleanup

We previously had only very short descriptions of what
-ignore-remote-version does due to having the documentation for it inline
on many different command pages and -help output.

Instead, we'll now centralize the documentation about this argument on
the remote backend page, and link to it or refer to it from all other
locations. This then allows us to spend more words on discussing what
Terraform normally does _without_ this option and warning about the
consequences of using it.

This continues earlier precedent for some local-backend-specific options
which we also don't recommend for typical use. While this does make these
options a little more "buried" than before, that feels justified given
that they are all "exceptional use only" sort of options where users ought
to learn about various caveats before using them.

While there I also took this opportunity to fix some earlier omissions
with the local-backend-specific options and a few other minor consistency
tweaks.
This commit is contained in:
Martin Atkins
2021-05-11 11:37:32 -07:00
parent b6885923d0
commit 874f1abb2b
13 changed files with 98 additions and 127 deletions

View File

@@ -77,10 +77,11 @@ in the configuration for the target resource, and that is the best behavior in m
the working directory. This flag can be used multiple times. This is only
useful with the `-config` flag.
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform import`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
For configurations using
[the `local` backend](/docs/language/settings/backends/local.html) only,

View File

@@ -38,29 +38,19 @@ This command requires a source and destination address of the item to move.
Addresses are
in [resource addressing format](/docs/cli/state/resource-addressing.html).
The command-line flags are all optional. The list of available flags are:
This command doesn't normally accept any command line options, except in
the special situations described in the following paragraphs.
* `-backup=path` - Path where Terraform should write the backup for the
original state. This can't be disabled. If not set, Terraform will write it
to the same path as the statefile with a ".backup" extension.
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform state mv`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
* `-backup-out=path` - Path where Terraform should write the backup for the
destination state. This can't be disabled. If not set, Terraform will write
it to the same path as the destination state file with a backup extension.
This only needs to be specified if -state-out is set to a different path than
-state.
* `-state=path` - Path to the source state file to read from. Defaults to the
configured backend, or "terraform.tfstate".
* `-state-out=path` - Path to the destination state file to write to. If this
isn't specified the source state file will be used. This can be a new or
existing path.
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
For configurations using
[the `local` state mv](/docs/language/settings/backends/local.html) only,
`terraform taint` also accepts the legacy options
[`-state`, `-state-out`, and `-backup`](/docs/language/settings/backends/local.html#command-line-arguments).
## Example: Rename a Resource

View File

@@ -43,9 +43,8 @@ Both of these safety checks can be disabled with the `-force` flag.
**This is not recommended.** If you disable the safety checks and are
pushing state, the destination state will be overwritten.
Other available flags:
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform state push`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).

View File

@@ -23,25 +23,25 @@ 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.
The command-line flags are all optional. The list of available flags are:
This command also accepts the following options:
* `-auto-approve` - Skip interactive approval.
* `-backup=path` - Path where Terraform should write the backup for the
original state. This can't be disabled. If not set, Terraform will write it
to the same path as the statefile with a ".backup" extension.
* `-lock=true`- Lock the state files when locking is supported.
* `-lock-timeout=0s` - Duration to retry a state lock.
* `-state=path` - Path to the source state file to read from. Defaults to the
configured backend, or "terraform.tfstate".
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform state replace-provider`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
For configurations using
[the `local` state rm](/docs/language/settings/backends/local.html) only,
`terraform state replace-provider` also accepts the legacy options
[`-state`, `-state-out`, and `-backup`](/docs/language/settings/backends/local.html#command-line-arguments).
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
## Example

View File

@@ -41,20 +41,19 @@ This command requires one or more addresses that point to a resources in the
state. Addresses are
in [resource addressing format](/docs/cli/state/resource-addressing.html).
The command-line flags are all optional. The list of available flags are:
This command doesn't normally accept any command line options, except in
the special situations described in the following paragraphs.
* `-backup=path` - Path where Terraform should write the backup state. This
can't be disabled. If not set, Terraform will write it to the same path as
the statefile with a backup extension.
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform state rm`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
* `-state=path` - Path to a Terraform state file to use to look up
Terraform-managed resources. By default it will use the configured backend,
or the default "terraform.tfstate" if it exists.
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
For configurations using
[the `local` state rm](/docs/language/settings/backends/local.html) only,
`terraform state rm` also accepts the legacy options
[`-state`, `-state-out`, and `-backup`](/docs/language/settings/backends/local.html#command-line-arguments).
## Example: Remove a Resource

View File

@@ -67,10 +67,11 @@ This command accepts the following options:
returning an error. The duration syntax is a number followed by a time
unit letter, such as "3s" for three seconds.
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform taint`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
For configurations using
[the `local` backend](/docs/language/settings/backends/local.html) only,

View File

@@ -62,12 +62,13 @@ This command also accepts the following options:
if you are running Terraform in a context where its output will be
rendered by a system that cannot interpret terminal formatting.
* `-ignore-remote-version` - When using the enhanced remote backend with
Terraform Cloud, continue even if remote and local Terraform versions differ.
This may result in an unusable Terraform Cloud workspace, and should be used
with extreme caution.
For configurations using
[the `remote` backend](/docs/language/settings/backends/remote.html)
only, `terraform untaint`
also accepts the option
[`-ignore-remote-version`](/docs/language/settings/backends/remote.html#command-line-arguments).
For configurations using
[the `local` backend](/docs/language/settings/backends/local.html) only,
`terraform taint` also accepts the legacy options
`terraform untaint` also accepts the legacy options
[`-state`, `-state-out`, and `-backup`](/docs/language/settings/backends/local.html#command-line-arguments).