diff --git a/command/import.go b/command/import.go index 4067e4fcc..3834e5e67 100644 --- a/command/import.go +++ b/command/import.go @@ -307,9 +307,9 @@ Options: -allow-missing-config Allow import when no resource configuration block exists. - -input=true Ask for input for variables if not directly set. + -input=false Disable interactive input prompts. - -lock=true Lock the state file when locking is supported. + -lock Lock the state file when locking is supported. -lock-timeout=0s Duration to retry a state lock. @@ -323,9 +323,8 @@ Options: a file. If "terraform.tfvars" or any ".auto.tfvars" files are present, they will be automatically loaded. - -ignore-remote-version Continue even if remote and local Terraform versions - are incompatible. This may result in an unusable - workspace, and should be used with extreme caution. + -ignore-remote-version A rare option used for the remote backend only. See + the remote backend documentation for more information. -state, state-out, and -backup are legacy options supported for the local backend only. For more information, see the local backend's documentation. diff --git a/command/state_mv.go b/command/state_mv.go index 6691aad30..9be27c15d 100644 --- a/command/state_mv.go +++ b/command/state_mv.go @@ -477,32 +477,15 @@ Options: -dry-run If set, prints out what would've been moved but doesn't actually move anything. - -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. - - -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. - - -lock=true Lock the state files when locking is supported. + -lock 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. Defaults to the - configured backend, or "terraform.tfstate" + -ignore-remote-version A rare option used for the remote backend only. See + the remote backend documentation for more information. - -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 Continue even if remote and local Terraform versions - are incompatible. This may result in an unusable - workspace, and should be used with extreme caution. + -state, state-out, and -backup are legacy options supported for the local + backend only. For more information, see the local backend's documentation. ` return strings.TrimSpace(helpText) diff --git a/command/state_replace_provider.go b/command/state_replace_provider.go index 2397f7d66..6f894fb7a 100644 --- a/command/state_replace_provider.go +++ b/command/state_replace_provider.go @@ -179,21 +179,15 @@ Options: -auto-approve Skip interactive approval. - -backup=PATH 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=true Lock the state files when locking is supported. + -lock Lock the state files when locking is supported. -lock-timeout=0s Duration to retry a state lock. - -state=PATH Path to the state file to update. Defaults to the - configured backend, or "terraform.tfstate" + -ignore-remote-version A rare option used for the remote backend only. See + the remote backend documentation for more information. - -ignore-remote-version Continue even if remote and local Terraform versions - are incompatible. This may result in an unusable - workspace, and should be used with extreme caution. + -state, state-out, and -backup are legacy options supported for the local + backend only. For more information, see the local backend's documentation. ` return strings.TrimSpace(helpText) diff --git a/command/taint.go b/command/taint.go index aef940db4..e68f27b8f 100644 --- a/command/taint.go +++ b/command/taint.go @@ -235,23 +235,15 @@ Options: -allow-missing If specified, the command will succeed (exit code 0) even if the resource is missing. - -backup=path Path to backup the existing state file before - modifying. Defaults to the "-state-out" path with - ".backup" extension. Set to "-" to disable backup. - - -lock=true Lock the state file when locking is supported. + -lock Lock the state file when locking is supported. -lock-timeout=0s Duration to retry a state lock. - -state=path Path to read and save state (unless state-out - is specified). Defaults to "terraform.tfstate". + -ignore-remote-version A rare option used for the remote backend only. See + the remote backend documentation for more information. - -state-out=path Path to write updated state file. By default, the - "-state" path will be used. - - -ignore-remote-version Continue even if remote and local Terraform versions - are incompatible. This may result in an unusable - workspace, and should be used with extreme caution. + -state, state-out, and -backup are legacy options supported for the local + backend only. For more information, see the local backend's documentation. ` return strings.TrimSpace(helpText) diff --git a/command/untaint.go b/command/untaint.go index 9b398f140..5df6d2c17 100644 --- a/command/untaint.go +++ b/command/untaint.go @@ -200,23 +200,15 @@ Options: -allow-missing If specified, the command will succeed (exit code 0) even if the resource is missing. - -backup=path Path to backup the existing state file before - modifying. Defaults to the "-state-out" path with - ".backup" extension. Set to "-" to disable backup. - - -lock=true Lock the state file when locking is supported. + -lock Lock the state file when locking is supported. -lock-timeout=0s Duration to retry a state lock. - -state=path Path to read and save state (unless state-out - is specified). Defaults to "terraform.tfstate". + -ignore-remote-version A rare option used for the remote backend only. See + the remote backend documentation for more information. - -state-out=path Path to write updated state file. By default, the - "-state" path will be used. - - -ignore-remote-version Continue even if remote and local Terraform versions - are incompatible. This may result in an unusable - workspace, and should be used with extreme caution. + -state, state-out, and -backup are legacy options supported for the local + backend only. For more information, see the local backend's documentation. ` return strings.TrimSpace(helpText) diff --git a/website/docs/cli/commands/import.html.md b/website/docs/cli/commands/import.html.md index 74b3ee9e3..0f03cd957 100644 --- a/website/docs/cli/commands/import.html.md +++ b/website/docs/cli/commands/import.html.md @@ -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, diff --git a/website/docs/cli/commands/state/mv.html.md b/website/docs/cli/commands/state/mv.html.md index 66fcbb764..510ffecca 100644 --- a/website/docs/cli/commands/state/mv.html.md +++ b/website/docs/cli/commands/state/mv.html.md @@ -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 diff --git a/website/docs/cli/commands/state/push.html.md b/website/docs/cli/commands/state/push.html.md index 1481e6bfe..2ba8f21da 100644 --- a/website/docs/cli/commands/state/push.html.md +++ b/website/docs/cli/commands/state/push.html.md @@ -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). diff --git a/website/docs/cli/commands/state/replace-provider.html.md b/website/docs/cli/commands/state/replace-provider.html.md index e98373729..8fb847c01 100644 --- a/website/docs/cli/commands/state/replace-provider.html.md +++ b/website/docs/cli/commands/state/replace-provider.html.md @@ -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 diff --git a/website/docs/cli/commands/state/rm.html.md b/website/docs/cli/commands/state/rm.html.md index 556a99d58..2ffa2af2b 100644 --- a/website/docs/cli/commands/state/rm.html.md +++ b/website/docs/cli/commands/state/rm.html.md @@ -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 diff --git a/website/docs/cli/commands/taint.html.md b/website/docs/cli/commands/taint.html.md index 84c2cbdbd..5c6c1fdea 100644 --- a/website/docs/cli/commands/taint.html.md +++ b/website/docs/cli/commands/taint.html.md @@ -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, diff --git a/website/docs/cli/commands/untaint.html.md b/website/docs/cli/commands/untaint.html.md index b505e7eda..6d1f0fac2 100644 --- a/website/docs/cli/commands/untaint.html.md +++ b/website/docs/cli/commands/untaint.html.md @@ -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). diff --git a/website/docs/language/settings/backends/remote.html.md b/website/docs/language/settings/backends/remote.html.md index 83350eae9..2691a7a0b 100644 --- a/website/docs/language/settings/backends/remote.html.md +++ b/website/docs/language/settings/backends/remote.html.md @@ -195,6 +195,26 @@ The following configuration options are supported: data source that retrieves state from another Terraform Cloud workspace. The `prefix` key is only intended for use when configuring an instance of the remote backend. +## Command Line Arguments + +For configurations that include a `backend "remote"` block, commands that +make local modifications to Terraform state and then push them back up to +the remote workspace accept the following option to modify that behavior: + +* `-ignore-remote-version` - Override checking that the local and remote + Terraform versions agree, making an operation proceed even when there is + a mismatch. + + Normally state-modification operations require using a local version of + Terraform CLI which is compatible with the Terraform version selected + for the remote workspace as part of its settings. This is to avoid the + local operation creating a new state snapshot which the workspace's + remote execution environment would then be unable to decode. + + Overriding this check can result in a Terraform Cloud workspace that is + no longer able to complete remote operations, so we recommend against + using this option. + ## Excluding Files from Upload with .terraformignore -> **Version note:** `.terraformignore` support was added in Terraform 0.12.11.