Movatterモバイル変換


[0]ホーム

URL:


AWS Region - AWS SDKs and Tools
DocumentationReference Guide
Support by AWS SDKs and tools

AWS Region

AWS Regions are an important concept to understand when working with AWS services.

With AWS Regions, you can access AWS 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 AWS 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 AWS service. For example, Amazon S3 and Amazon EC2 support cross-Region replication. Some services, such as IAM, do not have Regional resources.

TheAWS General Reference contains information on the following:

  • To understand the relationship between Regions and endpoints, and to view a list of existing Regional endpoints, seeAWS service endpoints.

  • To view the current list of all supported Regions and endpoints for each AWS service, seeService endpoints and quotas.

Creating service clients

To programmatically access AWS services, SDKs use a client class/object for each AWS 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 followingregion 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 AWSconfig file setting
AWS_REGION - environment variable
aws.region - JVM system property: Java/Kotlin only

Specifies the default AWS Region to use for AWS 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 inAWS service endpoints in theAWS General Reference. For example, the valueus-east-1 sets the endpoint to the AWS 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 AWS Security Token Service (AWS STS) and Amazon Simple Storage Service (Amazon S3).

Example of setting this value in theconfig 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 AWS SDK developer guide.

Support by AWS SDKs and tools

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 AWS SDK for Java and the AWS SDK for Kotlin only.

SDKSupportedNotes or more information
AWS CLI v2YesAWS CLI v2 uses any value inAWS_REGION before any value inAWS_DEFAULT_REGION (both variables are checked).
AWS CLI v1YesAWS CLI v1 uses environment variable namedAWS_DEFAULT_REGION for this purpose.
SDK for C++Yes
SDK for Go V2 (1.x)Yes
SDK for Go 1.x (V1)YesTo use sharedconfig file settings, you must turn on loading from the config file; seeSessions.
SDK for Java 2.xYes
SDK for Java 1.xYes
SDK for JavaScript 3.xYes
SDK for JavaScript 2.xYes
SDK for KotlinYes
SDK for .NET 4.xYes
SDK for .NET 3.xYes
SDK for PHP 3.xYes
SDK for Python (Boto3)YesThis SDK uses environment variable namedAWS_DEFAULT_REGION for this purpose.
SDK for Ruby 3.xYes
SDK for RustYes
SDK for SwiftYes
Tools for PowerShell V5Yes
Tools for PowerShell V4Yes
Amazon S3 Multi-Region Access Points
AWS STS Regional endpoints

[8]
ページ先頭

©2009-2025 Movatter.jp