DefaultChainCredentialsProvider

class DefaultChainCredentialsProvider(val profileName: String? = null, val platformProvider: PlatformProvider = PlatformProvider.System, httpClient: HttpClientEngine? = null, val region: String? = null) : CloseableCredentialsProvider

Default AWS credential provider chain used by most AWS SDKs.

Resolution order:

  1. System properties (SystemPropertyCredentialsProvider)

  2. Environment variables (EnvironmentCredentialsProvider)

  3. Web Identity Tokens (StsWebIdentityCredentialsProvider]

  4. Profile (ProfileCredentialsProvider)

  5. ECS (IAM roles for tasks) (EcsCredentialsProvider)

  6. EC2 Instance Metadata (IMDSv2) (ImdsCredentialsProvider)

The chain is decorated with a CachedCredentialsProvider.

Closing the chain will close all child providers that implement Closeable.

Return

the newly-constructed credentials provider

Parameters

profileName

Override the profile name to use. If not provided it will be resolved internally via environment (see AwsSdkSetting.AwsProfile) or defaulted to default if not configured.

platformProvider

The platform API provider

httpClient

the HttpClientEngine instance to use to make requests. NOTE: This engine's resources and lifetime are NOT managed by the provider. Caller is responsible for closing.

region

the region to make credentials requests to.

Constructors

Link copied to clipboard
constructor(profileName: String? = null, platformProvider: PlatformProvider = PlatformProvider.System, httpClient: HttpClientEngine? = null, region: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val profileName: String? = null
Link copied to clipboard
val region: String? = null

Functions

Link copied to clipboard
open override fun close()
Link copied to clipboard
open suspend override fun resolve(attributes: Attributes): Credentials
Link copied to clipboard
open override fun toString(): String