pub struct ProfileFileRetryConfigProvider { /* private fields */ }Expand description
Load retry configuration properties from a profile file
This provider will attempt to load AWS shared configuration, then read retry configuration properties from the active profile.
Location of Profile Files
- The location of the config file will be loaded from the
AWS_CONFIG_FILEenvironment variable with a fallback to~/.aws/config - The location of the credentials file will be loaded from the
AWS_SHARED_CREDENTIALS_FILEenvironment 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:
HOMEon all platformsUSERPROFILEon Windows- The concatenation of
HOMEDRIVEandHOMEPATHon Windows ($HOMEDRIVE$HOMEPATH)
Examples
Loads 2 as the max_attempts to make when sending a request
[default]
max_attempts = 2Loads standard as the retry_mode if and only if the other profile is selected.
[profile other]
retry_mode = standardThis provider is part of the default retry_config provider chain.
Implementations
sourceimpl ProfileFileRetryConfigProvider
impl ProfileFileRetryConfigProvider
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new ProfileFileRetryConfigProvider
To override the selected profile, set the AWS_PROFILE environment variable or use the Builder.
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Builder to construct a ProfileFileRetryConfigProvider
sourcepub async fn retry_config_builder(
&self
) -> Result<RetryConfigBuilder, RetryConfigErr>
pub async fn retry_config_builder(
&self
) -> Result<RetryConfigBuilder, RetryConfigErr>
Attempt to create a new RetryConfigBuilder from a profile file.