pub async fn build_aws_credential(
credentials_refresh_offset: Duration,
credentials: Option<AwsCredentialProvider>,
storage_options: Option<&HashMap<AmazonS3ConfigKey, String>>,
region: Option<String>,
) -> Result<(AwsCredentialProvider, String)>
Expand description
Build AWS credentials
This resolves credentials from the following sources in order:
- An explicit
credentials
provider - Explicit credentials in storage_options (as in
aws_access_key_id
,aws_secret_access_key
,aws_session_token
) - The default credential provider chain from AWS SDK.
credentials_refresh_offset
is the amount of time before expiry to refresh credentials.