Function aws_config::default_provider::app_name::default_provider

source ·
pub fn default_provider() -> Builder
Expand description

Default App Name Provider chain

This provider will check the following sources in order:

  1. Environment variables: AWS_SDK_UA_APP_ID
  2. Profile files from the key sdk_ua_app_id

§Location of Profile Files

  • The location of the config file will be loaded from the AWS_CONFIG_FILE environment variable with a fallback to ~/.aws/config
  • The location of the credentials file will be loaded from the AWS_SHARED_CREDENTIALS_FILE environment variable with a fallback to ~/.aws/credentials

The location of these files can also be customized programmatically using ProfileFiles.

§Home directory resolution

Home directory resolution is implemented to match the behavior of the CLI & Python. ~ is only used for home directory resolution when it:

  • Starts the path
  • Is followed immediately by / or a platform specific separator. (On windows, ~/ and ~\ both resolve to the home directory.

When determining the home directory, the following environment variables are checked:

  • HOME on all platforms
  • USERPROFILE on Windows
  • The concatenation of HOMEDRIVE and HOMEPATH on Windows ($HOMEDRIVE$HOMEPATH)

§Examples

Loads “my-app” as the app name

[default]
sdk_ua_app_id = my-app

Loads “my-app” as the app name if and only if the AWS_PROFILE environment variable is set to other.

[profile other]
sdk_ua_app_id = my-app