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