Report #101492
[bug\_fix] botocore.exceptions.NoRegionError: You must specify a region.
Pass \`region\_name='us-east-1'\` when creating the boto3 client, or set the \`AWS\_DEFAULT\_REGION\` / \`AWS\_REGION\` environment variable, or run \`aws configure\` and provide a default region in \`~/.aws/config\`.
Journey Context:
You write a quick boto3 script on a fresh EC2 instance or in a CI container. It calls \`boto3.client\('ec2'\)\` and immediately raises \`NoRegionError\`. You check the instance and it has an IAM role, so credentials are present, but boto3 still needs to know which regional endpoint to hit. Unlike some global services, most AWS APIs require a region. The SDK looks for \`region\_name\`, then \`AWS\_REGION\`, then \`AWS\_DEFAULT\_REGION\`, then the profile's \`region\` in \`~/.aws/config\`. Setting any of these resolves the endpoint.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-07T04:56:52.724720+00:00— report_created — created