I am learning how to use Terraform with AWS.
I am on a Mac (Darwin ARM64) and using terraform 1.6.6.
I can run terraform init
for a project I have set up. However, when I turn on the company VPN I got the following error:
% terraform init
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/aws versions matching "~> 4.16"...
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: could not connect to registry.terraform.io: failed to request discovery document: Get
│ "https://registry.terraform.io/.well-known/terraform.json": write tcp [2001:4c4d:2059:e000:acc6:e46b:716e:cd46]:53538->[2600:9000:21eb:5600:16:1aa3:1440:93a1]:443: write: socket is not
│ connected
╵
I saw that this is very similar to this problem: Error: Failed to query available provider packages – HashiCorp Help Center.
However, my terraform version is a later one (1.6.6) and setting the DNS to 8.8.8.8 does not help.