Course
data-engineering-zoomcamp
Question
If you are accessing Terraform from a restricted region (e.g., Iraq), you may be unable to reach the registry, resulting in initialization errors.
Error Message:
│ Error: Invalid provider registry host
│
│ The host "registry.terraform.io" given in provider source address "registry.terraform.io/hashicorp/google" does not offer a Terraform provider registry.
╵
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/google: could not connect to registry.terraform.io: failed to request discovery
│ document: Get "https://registry.terraform.io/.well-known/terraform.json": proxyconnect tcp: dial tcp: lookup http: no such host
Answer
This error occurs because the connection to registry.terraform.io is blocked.
- Important: Using a VPN browser extension is often not sufficient. Extensions typically only proxy traffic within the web browser, leaving your terminal/VS Code connection blocked.
- Fix: Install and activate a system-wide VPN software (e.g., Proton VPN, which is free and open source). This ensures that traffic from your terminal (where
terraform init runs) is correctly routed through the VPN.
- Once the system-wide VPN is active, run
terraform init again.
Checklist
Course
data-engineering-zoomcamp
Question
If you are accessing Terraform from a restricted region (e.g., Iraq), you may be unable to reach the registry, resulting in initialization errors.
Error Message:
Answer
This error occurs because the connection to
registry.terraform.iois blocked.terraform initruns) is correctly routed through the VPN.terraform initagain.Checklist