ImdsCredentialsProvider

class ImdsCredentialsProvider(val profileOverride: String? = null, val client: <Error class: unknown class><InstanceMetadataProvider> = lazy { ImdsClient() }, val platformProvider: <Error class: unknown class> = PlatformProvider.System, clock: <Error class: unknown class> = Clock.System)

CredentialsProvider that uses EC2 instance metadata service (IMDS) to provide credentials information. This provider requires that the EC2 instance has an instance profile configured.

See EC2 IAM Roles for more information.

Parameters

profileOverride

override the instance profile name. When retrieving credentials, a call must first be made to <IMDS_BASE_URL>/latest/meta-data/iam/security-credentials/. This returns the instance profile used. If profileOverride is set, the initial call to retrieve the profile is skipped and the provided value is used instead.

client

the IMDS client to use to resolve credentials information with. This provider takes ownership over the lifetime of the given ImdsClient and will close it when the provider is closed.

platformProvider

the PlatformEnvironProvider instance

Constructors

Link copied to clipboard
constructor(profileOverride: String? = null, client: <Error class: unknown class><InstanceMetadataProvider> = lazy { ImdsClient() }, platformProvider: <Error class: unknown class> = PlatformProvider.System, clock: <Error class: unknown class> = Clock.System)

Properties

Link copied to clipboard
val client: <Error class: unknown class><InstanceMetadataProvider>
Link copied to clipboard
val platformProvider: <Error class: unknown class>
Link copied to clipboard
val profileOverride: String? = null

Functions

Link copied to clipboard
open fun close()
Link copied to clipboard
open suspend fun resolve(attributes: <Error class: unknown class>): <Error class: unknown class>
Link copied to clipboard
open override fun toString(): String