I think I can’t have simpler setup:
# main.tf
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "5.83.1"
}
}
}
And I run:
terraform version && terraform providers && terraform init
Got:
Terraform v1.10.4
on linux_amd64
Providers required by configuration:
.
└── provider[registry.terraform.io/hashicorp/aws] 5.83.1
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/aws versions matching "5.83.1"...
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/aws: no available releases match the given constraints 5.83.1
│
│ To see which modules are currently depending on hashicorp/aws and what versions are specified, run the following command:
│ terraform providers
╵
What am I missing?
I have checked registry and everything sounds good:
curl https://registry.terraform.io/v1/providers/hashicorp/aws/versions | jq '.versions | map(select(.version == "5.83.1"))'
[
{
"version": "5.83.1",
"protocols": [
"5.0"
],
"platforms": [
{
"os": "linux",
"arch": "arm"
},
{
"os": "freebsd",
"arch": "amd64"
},
{
"os": "linux",
"arch": "arm64"
},
{
"os": "freebsd",
"arch": "386"
},
{
"os": "linux",
"arch": "386"
},
{
"os": "freebsd",
"arch": "arm"
},
{
"os": "openbsd",
"arch": "amd64"
},
{
"os": "openbsd",
"arch": "386"
},
{
"os": "darwin",
"arch": "amd64"
},
{
"os": "openbsd",
"arch": "arm"
},
{
"os": "windows",
"arch": "amd64"
},
{
"os": "windows",
"arch": "386"
},
{
"os": "linux",
"arch": "amd64"
},
{
"os": "darwin",
"arch": "arm64"
}
]
}
]
I don’t know if I can check something against protocols and platforms values…
I finally cleared my ~/.terraform.d directory and Terraform was happy. Then I had another issue when using Terragrunt. I needed to clear again ~/.terraform.d and also ~/.terragrunt…