I've encountered an issue while running Terraform, and it appears to be related to the provider requirements in the versions.tf file of my module. The error I'm encountering is:
Finding hashicorp/aws versions matching ">= 3.50, < 5.0"...
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 >= 3.50, < 5.0
Upon reviewing the code, I noticed that the required_providers block in versions.tf file is specified as follows:
terraform {
required_version = ">= 0.12.20, < 2.0"
required_providers {
aws = ">= 3.50, < 5.0"
}
}
However, it seems there's an issue with this version specification, as I'm getting an error when running Terraform. I propose updating the required_providers block in the versions.tf file as follows:
terraform {
required_version = ">= 0.12.20, < 2.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 3.50"
}
}
}
This modification should resolve the issue and ensure the correct resolution of AWS provider versions.
Thank you for your attention.