Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

AWS Region selection

Focus mode
AWS Region selection - AWS SDK for Rust

You can access AWS services that operate in a specific geographic area by using AWS Regions. This can be useful both for redundancy and to keep your data and applications running close to where you and your users access them. For more information on how Regions are used, see AWS Region in the AWS SDKs and Tools Reference Guide.

Important

Most resources reside in a specific AWS Region and you must supply the correct Region for the resource when using the SDK.

AWS Region provider chain

The following lookup process is used when loading a service client's configuration from the execution environment. The first value that the SDK finds set is used in the configuration of the client. For more information on creating service clients, see Configure a client from the environment.

  1. Any explicit Region set programmatically.

  2. The AWS_REGION environment variable is checked.

    • If you are using the AWS Lambda service, this environment variable is set automatically by the AWS Lambda container.

  3. The region property in the shared AWS config file is checked.

    • The AWS_CONFIG_FILE environment variable can be used to change the location of the shared config file. To learn more about where this file is kept, see Location of the shared config and credentials files in the AWS SDKs and Tools Reference Guide.

    • The AWS_PROFILE environment variable can be used to select a named profile instead of the default. To learn more about configuring different profiles, see Shared config and credentials files in the AWS SDKs and Tools Reference Guide.

  4. The SDK attempts to use the Amazon EC2 Instance Metadata Service to determine the Region of the currently running Amazon EC2 instance.

    • The AWS SDK for Rust only supports IMDSv2.

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.