diff --git a/registry/client.go b/registry/client.go index dcbb0debb..a4a80e021 100644 --- a/registry/client.go +++ b/registry/client.go @@ -368,6 +368,8 @@ func (c *Client) TerraformProviderLocation(provider *regsrc.TerraformProvider, v return &loc, nil } +// configureDiscoveryRetry configures the number of retries the registry client +// will attempt for requests with retryable errors, like 502 status codes func configureDiscoveryRetry() { discoveryRetry = defaultRetry diff --git a/website/docs/commands/environment-variables.html.md b/website/docs/commands/environment-variables.html.md index c163dc625..0a79aa9d6 100644 --- a/website/docs/commands/environment-variables.html.md +++ b/website/docs/commands/environment-variables.html.md @@ -114,6 +114,12 @@ exact output differences can change between minor Terraform versions. For more details see [Running Terraform in Automation](https://learn.hashicorp.com/terraform/development/running-terraform-in-automation). +## TF_REGISTRY_DISCOVERY_RETRY + +Set `TF_REGISTRY_DISCOVERY_RETRY` to configure the max number of request retries +the remote registry client will attempt for client connection errors or +500-range responses that are safe to retry. + ## TF_CLI_CONFIG_FILE The location of the [Terraform CLI configuration file](/docs/commands/cli-config.html).