Skip to main content

resolve_aws_credentials

Function resolve_aws_credentials 

Source
pub fn resolve_aws_credentials(
    auth: &AuthStorage,
) -> Option<AwsResolvedCredentials>
Expand description

Resolve AWS credentials following the standard precedence chain.

Precedence (first match wins):

  1. AWS_BEARER_TOKEN_BEDROCK env var → bearer token auth
  2. AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY env vars → Sigv4
  3. AWS_PROFILE env var → profile-based (returns the profile name for external resolution)
  4. Stored AwsCredentials in auth.json
  5. Stored BearerToken in auth.json (for bedrock)

region is resolved from: AWS_REGIONAWS_DEFAULT_REGION"us-east-1".