

# Amazon Web Services Region
<a name="feature-region"></a>

**Note**  
For help in understanding the layout of settings pages, or in interpreting the **Support by Amazon SDKs and tools** table that follows, see [Understanding the settings pages of this guide](settings-reference.md#settingsPages).

Amazon Web Services Regions are an important concept to understand when working with Amazon Web Services services. 

With Amazon Web Services Regions, you can access Amazon Web Services services that physically reside in a specific geographic area. This can be useful to keep your data and applications running close to where you and your users will access them. Regions provide fault tolerance, stability, and resilience, and can also reduce latency. With Regions, you can create redundant resources that remain available and unaffected by a Regional outage.

Most Amazon Web Services service requests are associated with a particular geographic region. The resources that you create in one Region do not exist in any other Region unless you explicitly use a replication feature offered by an Amazon Web Services service. For example, Amazon S3 and Amazon EC2 support cross-Region replication. Some services, such as IAM, do not have Regional resources.

The *Amazon Web Services General Reference* contains information on the following:
+  To understand the relationship between Regions and endpoints, and to view a list of existing Regional endpoints, see [Amazon service endpoints](https://docs.amazonaws.cn/general/latest/gr/rande.html).
+ To view the current list of all supported Regions and endpoints for each Amazon Web Services service, see [Service endpoints and quotas](https://docs.amazonaws.cn/general/latest/gr/aws-service-information.html).

**Creating service clients**

To programmatically access Amazon Web Services services, SDKs use a client class/object for each Amazon Web Services service. If your application needs to access Amazon EC2, for example, your application would create an Amazon EC2 client object to interface with that service.

If no Region is explicitly specified for the client in the code itself, the client defaults to using the Region that is set through the following `region` setting. However, the active Region for a client can be explicitly set for any individual client object. Setting the Region in this way takes precedence over any global setting for that particular service client. The alternative Region is specified during instantiation of that client, specific to your SDK (check your specific SDK Guide or your SDK's code base).

Configure this functionality by using the following:

**`region` - shared Amazon `config` file setting`AWS_REGION` - environment variable`aws.region` - JVM system property: Java/Kotlin only**  
Specifies the default Amazon Web Services Region to use for Amazon requests. This Region is used for SDK service requests that aren't provided with a specific Region to use.  
**Default value:** None. You must specify this value explicitly.  
**Valid values:**   
+ Any of the Region codes available for the chosen service, as listed in [Amazon service endpoints](https://docs.amazonaws.cn/general/latest/gr/rande.html) in the *Amazon General Reference*. For example, the value `us-east-1` sets the endpoint to the Amazon Web Services Region US East (N. Virginia).
+ `aws-global` specifies the global endpoint for services that support a separate global endpoint in addition to Regional endpoints, such as Amazon Security Token Service (Amazon STS) and Amazon Simple Storage Service (Amazon S3).

Example of setting this value in the `config` file:

```
[default]
region = us-west-2
```

Linux/macOS example of setting environment variables via command line:

```
export AWS_REGION=us-west-2
```

Windows example of setting environment variables via command line:

```
setx AWS_REGION us-west-2
```

Most SDKs have a "configuration" object that is available for setting the default Region from within the application code. For details, see your specific Amazon SDK developer guide.

## Support by Amazon SDKs and tools
<a name="feature-region-sdk-compat"></a>

The following SDKs support the features and settings described in this topic. Any partial exceptions are noted. Any JVM system property settings are supported by the Amazon SDK for Java and the Amazon SDK for Kotlin only.


| SDK | Supported | Notes or more information | 
| --- | --- | --- | 
| [Amazon CLI v2](https://docs.amazonaws.cn/cli/latest/userguide/) | Yes | Amazon CLI v2 uses any value in AWS\_REGION before any value in AWS\_DEFAULT\_REGION (both variables are checked). | 
| [Amazon CLI v1](https://docs.amazonaws.cn/cli/v1/userguide/cli-chap-welcome.html) | Yes | Amazon CLI v1 uses environment variable named AWS\_DEFAULT\_REGION for this purpose. | 
| [SDK for C\+\+](https://docs.amazonaws.cn/sdk-for-cpp/latest/developer-guide/) | Yes |  | 
| [SDK for Go V2 (1.x)](https://docs.aws.amazon.com/sdk-for-go/v2/developer-guide/) | Yes |  | 
| [SDK for Go 1.x (V1)](https://docs.amazonaws.cn/sdk-for-go/latest/developer-guide/) | Yes | To use shared config file settings, you must turn on loading from the config file; see [Sessions](https://docs.amazonaws.cn/sdk-for-go/api/aws/session/). | 
| [SDK for Java 2.x](https://docs.amazonaws.cn/sdk-for-java/latest/developer-guide/) | Yes |  | 
| [SDK for Java 1.x](https://docs.amazonaws.cn/sdk-for-java/v1/developer-guide/) | Yes |  | 
| [SDK for JavaScript 3.x](https://docs.amazonaws.cn/sdk-for-javascript/latest/developer-guide/) | Yes |  | 
| [SDK for JavaScript 2.x](https://docs.amazonaws.cn/sdk-for-javascript/v2/developer-guide/) | Yes |  | 
| [SDK for Kotlin](https://docs.amazonaws.cn/sdk-for-kotlin/latest/developer-guide/) | Yes |  | 
| [SDK for .NET 4.x](https://docs.amazonaws.cn/sdk-for-net/latest/developer-guide/) | Yes |  | 
| [SDK for .NET 3.x](https://docs.amazonaws.cn/sdk-for-net/v3/developer-guide/) | Yes |  | 
| [SDK for PHP 3.x](https://docs.amazonaws.cn/sdk-for-php/latest/developer-guide/) | Yes |  | 
| [SDK for Python (Boto3)](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html) | Yes | This SDK uses environment variable named AWS\_DEFAULT\_REGION for this purpose. | 
| [SDK for Ruby 3.x](https://docs.amazonaws.cn/sdk-for-ruby/latest/developer-guide/) | Yes |  | 
| [SDK for Rust](https://docs.amazonaws.cn/sdk-for-rust/latest/dg/) | Yes |  | 
| [SDK for Swift](https://docs.amazonaws.cn/sdk-for-swift/latest/developer-guide/) | Yes |  | 
| [Tools for PowerShell V5](https://docs.amazonaws.cn/powershell/latest/userguide/) | Yes |  | 
| [Tools for PowerShell V4](https://docs.amazonaws.cn/powershell/v4/userguide/) | Yes |  | 