From 2a1d98bc065d3e30e2b6b85549d7eb9ab9d34591 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Wed, 1 Mar 2023 09:15:36 -0800 Subject: [PATCH] website: Document TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE env var This is an alternative way to set the CLI configuration setting plugin_cache_may_break_dependency_lock_file to activate the transitional compatibility behavior that prefers to break the dependency lock file if that would create an additional opportunity to use the plugin cache. --- website/docs/cli/config/config-file.mdx | 6 +++++- website/docs/cli/config/environment-variables.mdx | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/website/docs/cli/config/config-file.mdx b/website/docs/cli/config/config-file.mdx index accdc465fc..c3884f683d 100644 --- a/website/docs/cli/config/config-file.mdx +++ b/website/docs/cli/config/config-file.mdx @@ -387,7 +387,7 @@ grow to contain several unused versions which you must delete manually. safe. The provider installer's behavior in environments with multiple `terraform init` calls is undefined. -## Allowing the Provider Plugin Cache to break the dependency lock file +### Allowing the Provider Plugin Cache to break the dependency lock file ~> **Note:** The option described in is for unusual and exceptional situations only. Do not set this option unless you are sure you need it and you fully @@ -415,6 +415,10 @@ to confirm it: plugin_cache_may_break_dependency_lock_file = true ``` +Alternatively, you can set the environment variable +`TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE` to any value other than the +empty string or `0`, which is equivalent to the above setting. + Setting this option gives Terraform CLI permission to create an incomplete dependency lock file entry for a provider if that would allow Terraform to use the cache to install that provider. In that situation the dependency lock diff --git a/website/docs/cli/config/environment-variables.mdx b/website/docs/cli/config/environment-variables.mdx index 807c5349e5..078e15a0fc 100644 --- a/website/docs/cli/config/environment-variables.mdx +++ b/website/docs/cli/config/environment-variables.mdx @@ -151,6 +151,12 @@ The location of the [Terraform CLI configuration file](/terraform/cli/config/con export TF_CLI_CONFIG_FILE="$HOME/.terraformrc-custom" ``` +## TF_PLUGIN_CACHE_DIR + +The `TF_PLUGIN_CACHE_DIR` environment variable is an alternative way to set [the `plugin_cache_dir` setting in the CLI configuration](/terraform/cli/config/config-file#provider-plugin-cache). + +You can also use `TF_PLUGIN_CACHE_MAY_BREAK_DEPENDENCY_LOCK_FILE` to activate [the transitional compatibility setting `plugin_cache_may_break_dependency_lock_file`](/terraform/cli/config/config-file#allowing-the-provider-plugin-cache-to-break-the-dependency-lock-file). + ## TF_IGNORE If `TF_IGNORE` is set to "trace", Terraform will output debug messages to display ignored files and folders. This is useful when debugging large repositories with `.terraformignore` files.