diff --git a/.changes/next-release/enhancement-Endpoints-18366.json b/.changes/next-release/enhancement-Endpoints-18366.json new file mode 100644 index 0000000000..224c76fb35 --- /dev/null +++ b/.changes/next-release/enhancement-Endpoints-18366.json @@ -0,0 +1,5 @@ +{ + "type": "enhancement", + "category": "Endpoints", + "description": "Improve the NoRegionError message to explain how to set a region (region_name, AWS_DEFAULT_REGION, or ~/.aws/config)." +} diff --git a/botocore/exceptions.py b/botocore/exceptions.py index 294bbf4020..fee4a968f9 100644 --- a/botocore/exceptions.py +++ b/botocore/exceptions.py @@ -243,7 +243,11 @@ class BaseEndpointResolverError(BotoCoreError): class NoRegionError(BaseEndpointResolverError): """No region was specified.""" - fmt = 'You must specify a region.' + fmt = ( + 'You must specify a region. This can be done by passing the region_name ' + 'argument to the client or session, using the AWS_DEFAULT_REGION ' + 'environment variable, or setting "region" in the aws config file.' + ) class EndpointVariantError(BaseEndpointResolverError):