Unfortunately it seems like Terraform on your system was unable to connect to the Terraform registry in order to see which versions of
hashicorp/aws are available, and so the installation failed. This sort of problem is not easy to diagnose remotely because I can’t see any details about your internet connection, what restrictions might be in place on your local network, etc.
If you are unable to reach the registry but you can reach the provider releases index directly, an alternative way to install the provider would be to manually download the version Terraform would’ve selected automatically (at the time of writing that would be v2.70.0) and extract it to one of the directories Terraform searches for local provider “mirrors”.
For example, if you are using Linux on an x64/AMD64 processor then you could extract the
linux_amd64 release zip file into the following directory:
terraform init should then find that file and use the local directory instead of accessing the remote Terraform Registry.
With that said, this manual installation method means you won’t be able to automatically upgrade to later versions of the provider, so I’d still recommend trying to understand what setting on your computer or local network is causing Terraform to be unable to connect to
registry.terraform.io. If you do later find a way to make that work, you can remove the
~/.local/share/terraform/plugins directory to restore Terraform’s default behavior of accessing the remote registry for direct installation.