why my basic terraform fails to run terraform plan?
Ok, I resolved the issue.
My problem was not in credentials file but in config.
For some reason I had this:
[default]
output = json
region = eu-west-1
source_profile = default

removing source_profile makes it work.

I have this very basic terraform file: main.tf
terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 4.16"
    }
  }

  required_version = ">= 1.2.0"
}

provider "aws" {
    profile = "default"
}

resource "aws_s3_bucket" "test-bucket-terraform-regergjegreg" {
  bucket = "test-bucket-terraform-regergjegreg"

  tags = {
    Name        = "My bucket"
    Environment = "Dev"
  }
}

when doing terraform validate, I have no error:
Success! The configuration is valid.
Now when I do terraform plan, I got this error:
Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: configuring Terraform AWS Provider: credential type source_profile requires role_arn, profile default
│ 
│   with provider["registry.terraform.io/hashicorp/aws"],
│   on main.tf line 12, in provider "aws":
│   12: provider "aws" {
│ 
╵

Here is my terraform version:
Terraform v1.4.6
on darwin_amd64
+ provider registry.terraform.io/hashicorp/aws v3.76.1

the default profile exists in my /.aws/credentials and /.aws/config
Not sure what could be wrong really. Any help is appreciated. thanks
