Failed to query available provider packages for AWS

I am getting below error while init the terraform. Please suggest.

.\terraform init

Initializing the backend…
Initializing modules…
Initializing provider plugins…

  • Finding hashicorp/aws versions matching “~> 3.74, ~> 4.25”…

    │ 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.74, ~>
    │ 4.25

Your Terraform code has some provider constraints, presumably because you are using various modules which have those set.

In particular it is saying it needs the AWS provider to be a 3.X version (at least 3.74) as well as being a 4.X version (at least 4.25). This is impossible (you can use either version 3 or version 4, but not both).

To fix this you’d need to change your code to depend on modules that don’t have contradictory requirements. I’d suggest upgrading the module which requires the v3 provider version to a newer update that has moved over to v4. Alternatively you could downgrade the modules which need v4 to an other one that needs v3.