What "Region is missing", "NoRegionError: You must specify a region" and "Invalid Configuration: Missing Region" mean in the JavaScript, Python and Go AWS SDKs, where each SDK looks for a region, and why AWS_REGION alone does not fix boto3.

Every AWS API call goes to a regional endpoint, so a client with no region fails before sending anything. JavaScript v3 says Region is missing, boto3 raises NoRegionError, and Go v2 reports Invalid Configuration: Missing Region.
In nearly every case the code works on a laptop with a profile and fails in a container, a CI job or a test.
I reproduced each error with credentials set and every region source removed, using @aws-sdk/client-s3 3.1173, boto3 1.44.7 and aws-sdk-go-v2 config v1.33.21.
AWS_REGION and AWS_DEFAULT_REGION are not interchangeable: the AWS SDKs reference guide lists AWS_REGION as the standard variable, but boto3 still reads AWS_DEFAULT_REGION, as its configuration guide shows. The JavaScript SDK goes the other way and ignores AWS_DEFAULT_REGION:
A Dockerfile or CI job that sets only one of them fixes one language and breaks the other. Setting both is the cheap fix for polyglot repos. Lambda sets both for every function, which is why the same code works there and fails elsewhere.
On a laptop the region usually comes from ~/.aws/config, in the profile AWS_PROFILE points at. A container does not see that file unless you mount it, and a CI runner has no profile at all. Some setups also put credentials in ~/.aws/credentials and the region only in ~/.aws/config, so mounting only the credentials file gives you a working identity and no region.
In GitHub Actions, the aws-actions/configure-aws-credentials action takes a required aws-region input and exports it for later steps. A job that sets credentials through plain secrets instead needs the region set explicitly in env.
On EC2, boto3 and recent JavaScript v3 releases fall back to the region in the instance metadata service. Go v2 only does that when you load config with config.WithEC2IMDSRegion(), per the Go SDK configuration guide. Fargate tasks have no EC2 instance metadata, so set AWS_REGION and AWS_DEFAULT_REGION in the task definition rather than relying on that fallback.
Passing the region in code, S3Client({ region }), boto3.client("s3", region_name=...) or config.WithRegion(...), always works and is the right call for clients that must talk to a specific region, such as a replication job. For everything else it ties the code to one deployment. Read it from configuration so staging and production can live in different regions without a code change.
Encore brings infrastructure from code: a Go service declares the resources it uses, such as an object storage bucket, and Encore provisions them in your AWS account in the region you pick for the environment. The service code holds no region, endpoint or credentials, so there is no variable to forget in a container or CI job.

Run in your terminal to get started locally.
// snapshots/snapshots.go
package snapshots
import (
"context"
"encoding/json"
"fmt"
"time"
"encore.dev/storage/objects"
)
// S3 on AWS, Cloud Storage on GCP, a local bucket under `encore run`.
// No region, endpoint or credentials in code: Encore supplies them per environment.
var Snapshots = objects.NewBucket("pricing-snapshots", objects.BucketConfig{})
type SaveParams struct {
Prices map[string]int `json:"prices"`
}
type SaveResponse struct {
Key string `json:"key"`
}
//encore:api private method=POST path=/snapshots
func Save(ctx context.Context, p *SaveParams) (*SaveResponse, error) {
key := fmt.Sprintf("prices/%s.json", time.Now().UTC().Format("2006-01-02T15-04-05"))
w := Snapshots.Upload(ctx, key, objects.WithUploadAttrs(objects.UploadAttrs{
ContentType: "application/json",
}))
if err := json.NewEncoder(w).Encode(p.Prices); err != nil {
w.Abort(err)
return nil, err
}
if err := w.Close(); err != nil {
return nil, err
}
return &SaveResponse{Key: key}, nil
}
encore run stores the snapshots in a local bucket, and on deploy the same service gets an S3 bucket in the environment's region, and Encore provisions an IAM role for the service. The AWS infrastructure docs list what else Encore creates, and connecting your cloud covers choosing the region.
A coding agent that adds a bucket or a topic declares it in Go and runs it locally straight away, with no region, endpoint or IAM policy to wire up in a separate change.
Best fit: Teams calling S3, SNS or SQS from several services who keep chasing region and credential configuration across laptops, CI and containers.
boto3 reads AWS_DEFAULT_REGION, not AWS_REGION. Tested with boto3 1.44.7, a client created with only AWS_REGION set raises NoRegionError, and the same client works with AWS_DEFAULT_REGION. Set both in containers and CI so every SDK finds a region.
AWS_REGION. It ignores AWS_DEFAULT_REGION, then checks the region in your shared config profile, then the EC2 instance metadata service, and throws Region is missing if none of them answer.
Yes. config.LoadDefaultConfig accepts AWS_REGION or AWS_DEFAULT_REGION and the profile region. It does not ask the instance metadata service unless you pass config.WithEC2IMDSRegion().
Encore apps declare resources such as buckets in code and never configure a region, endpoint or credentials for them. Encore supplies those per environment when it provisions the resources in your AWS account.
Deploy to your cloud on AWS and Google Cloud
without managing infrastructure
Encore lets developers and agents define application infrastructure directly in code, then automatically provisions it from local development to production in your AWS or GCP account.