Why region is needed while implementing s3 backend if we don't want to use dynamo DB

why region parameter is made as mandatory while creating backend.tf as the scope of s3 is global.
and also if we don’t want to use dynamo DB for locking.

terraform {
  backend "s3" {
    bucket = "mybucket"
    key    = "path/to/my/key"
    region = "us-east-1"
  }

and below is mentioned in the documentation.

  • region - (Required) AWS Region of the S3 Bucket and DynamoDB Table (if used). This can also be sourced from the AWS_DEFAULT_REGION and AWS_REGION environment variables.

Hi @jainpratik163,

While access to S3 buckets is global, they are still located within a specific region

…, you must first create an S3 bucket in one of the AWS Regions.

IIRC this also means that the client which writes to the bucket must declare the region correctly in order to access that bucket, but it’s been a long time since I worked directly with the AWS api myself.

It very well could be a case that is no longer needed, as the constraints of the system have changed over time. For example, the consistency model of S3 has changed recently so that DynamicDB is no longer needed for basic read consistency after writes, but the backend client has not been updated to reflect this.