Run terraform commands using the attached role in the instance

i have terraform installed in EC2 instance in AWS, the instance does have a role attached to it and i can run AWS CLI commands from the instance

when running “terraform plan” command i get the error
error configuring Terraform AWS Provider: failed to get shared config profile,

is there a way to use the attached role instead of the credential profile?