User's .terraformrc is not taking precedence

Hi All, We have an issue with some servers which can’t connect externally to download plugins. To overcome this, we came up with ‘dev_override solution in .terraformrc that is in user home path as below.

provider_installation {
dev_overrides {
“ Terraform Registry” = “/home//tf-proj-qa/”
}
}

Along this config, we already have the provider config in main.cf.

terraform {
required_providers {
aws = {
source = “hashicorp/aws”
version = “~> 6.28.0”
}
}
}

As far as I know, .terraform honors “required_providers“ block in main.cf. When ‘‘terraform init‘ executes, it checks first in .terraformrc, and if not found, it checks required_providers block and do downloading the binary.

The problem here is, though the .terraformrc is in place, it is being bypassed and terraform trying to connect external.

Trace Logs:

[INFO] Loading CLI configuration from /home//tf-proj-qa/.terraformrc
[DEBUG] Explicit provider installation configuration is set

[DEBUG] Provider Terraform Registry is overridden by dev_overrides
Initializing provider plugins…

Finding hashicorp/aws versions matching “~> 6.28.0”…
[DEBUG] Service discovery for registry.terraform.io at registry.terraform.io/.well-known/terraform.json

Hi @ramaswamy_27,

First, the required_providers does not define an installation method, it’s only declaring the provider requirements. The configuration files can’t override this, but they can be used to offer alternative installation methods.

Your use of dev_overrides is incorrect, I’m not sure where you got that information, but the docs have a correct example. I don’t think you’re looking for developer overrides however, what you want is probably the filesystem_mirror option for explicit provider installation.

Thanks @jbardin , I will explore the mirror methods.