Terraform BucketRegionError

I am getting below error while running terraform script in west region.Earlier it was working fine but it started failing from 1 week.Below is the error.
Error: BucketRegionError: incorrect region, the bucket is not in ‘us-west-2’ region at endpoint ‘’
The state bucket exists in west region as well but not sure why it is throwing this error.Provider block is also there.

Can we get any update please?

hard to give an update when no terraform config was given.

Confirm the region of the bucket with aws s3api get-bucket-location --bucket bucket_name and make sure that matches the region of the aws provider used in the terraform config. Note that the LocationConstraint returned for a us-east-1 bucket will be null.

[quote=“grimm26, post:4, topic:52288”]
aws s3api get-bucket-location --bucket bucket_name
[/quote

It shows the bucket is in west region and the provider is also configured to use west region

what is “west region?”

the region name is us-west-2 region.

If possible can we have a call

This is not a support line. This is a community forum. I do not work for hashicorp.

If you supply your actual terraform config, people may be able to help you. Also what version of terraform and aws provider you are using.

You mentioned that the provider has the right region set, but what about the backend block? Is that bucket used for state storage? Are you explicitly setting the region or using env vars to set it?

Terraform v0.13.7

  • Installing hashicorp/aws v4.61.0…

My terraform config is so big Are you okay with it?

We are using terragrunt file for backend config.See the below config.

printing terragrunt.hcl file

printing terragrunt.hcl file
remote_state {
backend = “s3”
config = {
bucket = “uswest2-nlsn-tam-mw-collections-terraform-state-np”
key = “collections-2.0/mcs-ngnix-infra/us-west-2/dev/terraform.tfstate”
region = “us-west-2”
encrypt = true
dynamodb_table = “collections-all-env-state-table”
}
}

well, you’re using a pretty out of date terraform version. If you want to post your whole gigantic terraform config, put it into a github gist and post the link here.