Failed to get existing workspaces

I have used an S3 bucket for saving state, today I tried to create a new TF faile and wanted to save the state in S3 - My buckets originally where in eu-west-2 for this I wanted to use US-East-1 I had the AWS_DEFAULT_REGION set to us-east and in the script had the bucket in eu-west-2 I got this error

Error: Failed to get existing workspaces: AuthorizationHeaderMalformed: The authorization header is malformed; the region ‘us-east-1’ is wrong; expecting 'eu-west-2’

status code: 400, request id: 12DC6E0CBE88A85B, host id: 8T6u+4U6ui3GSNcLyR9UIGsbr5IbARB04Te2CBN5YwIzrG5ktFGT8NRHJ1D9U7m3VfD4TR5WnNc=

I then tried adding the provider in the script and first off had it set to us-east and removed the AWS_DEFAULT variable - Same error

I then changed the file as shown below with NO AWS_DEFAULT (I unset it and logged out!) but I still get the same error.

terraform {
backend “s3” {
# Replace this with your bucket name!
bucket = “uniquebucketname” ----- I changed this to hide the real bucket
key = “global/s3/sfinspectordefault/terraform.tfstate”
region = “eu-west-2”
}
}

provider “aws” {
version = “~> 2.0”
region = “eu-west-2”
}

I have fixed this.

I removed the AWS_DEFAULT_REGION as I mentioned previously.

Then I deleted .terraform directory

Changed my code as below

terraform {
backend “s3” {

Replace this with your bucket name!

bucket = “uniquebucketname” ----- I changed this to hide the real bucket
key = “global/s3/sfinspectordefault/terraform.tfstate”
region = “eu-west-2”
}
}

provider “aws” {
version = “~> 2.0”
region = “us-east-1”
}

Terraform now initializes