[Solved] Terraform Error accessing remote module registry in PowerShell
If you are using PowerShell and trying to run a terraform init
, you may get an error as follows:
Error: error accessing remote module registry
Failed to retrieve available versions for module ... from registry.terraform.io: Failed to request discovery document: Get "https://registry.terraform.io/.well-known/terraform.json": read tcp x.x.x.x:xxxx->x.x.x.x: wsarecv: An existing connection was forcibly closed by the remote host..
Note that you will still be able to make a successful curl
request, but terraform
will fail!
The problem
You need to make sure you have a proxy set.
The Windows Command Prompt lets you set a proxy as follows:
The solution
PowerShell will still fail, as it required the proxy environment variables to also be set as follows:
|
|