Interview Prep/Terraform/Dependencies, Cycles and Providers

`terraform init` fails behind a firewall: `could not connect to registry.terraform.io: failed to request discovery document`.

IntermediateTroubleshootingDependencies, Cycles and Providers
Answer

Likely causes → No outbound internet, a proxy without its CA trusted, or a blocked releases.hashicorp.com (providers download from there after registry lookup).

Diagnose →

curl -sv https://registry.terraform.io/.well-known/terraform.json
curl -sI https://releases.hashicorp.com/

Fix → Configure HTTPS_PROXY and trust the proxy CA, or use a provider mirror:

# ~/.terraformrc
provider_installation {
  network_mirror {
    url = "https://tf-mirror.internal.example.com/"
  }
}

Prevent → For air-gapped runners, prepare mirrors with terraform providers mirror ./mirror and bake them into the runner image.

All Terraform questions Roadmap: Terraform

More on Dependencies, Cycles and Providers