Error: error configuring Terraform AWS Provider: failed to get shared config profile, default

Hey Team,

Good Day All!

We need your suggestion here recently we have upgraded terraform version to 1.17 and required provider as below.

required_providers {
aws = {
source = “hashicorp/aws”
version = “>= 4.8.0”
}
random = {
source = “hashicorp/random”
version = “>= 2.0”
}

We are getting strange error where provider is looking for the aws config file…and failing locally and as well CI/CD Pipeline.

Same configuration works with older version like.

Pin Terraform and provider versions as necessary for the root and child module

terraform {
required_version = “~> 1.1.7”

required_providers {
aws = {
source = “hashicorp/aws”
version = “~> 3.7”
}
random = “>= 2”
}
}

Please let us know what changes we need to do.

Regards,
Shibir G R
DevOps Engineer