ImdsCredentialsProvider

class ImdsCredentialsProvider(instanceProfileName: String? = null, client: InstanceMetadataProvider? = null, platformProvider: PlatformProvider = PlatformProvider.System) : CloseableCredentialsProvider

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

Parameters

instanceProfileName

overrides the instance profile name. When set, this provider skips querying IMDS for the name of the active profile.

client

a preconfigured IMDS client with which to retrieve instance metadata. If an instance is passed, the caller is responsible for closing it. If no instance is passed, a default instance is created and will be closed when this credentials provider is closed.

platformProvider

a platform provider used for env vars and system properties

Constructors

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

Properties

Link copied to clipboard
Link copied to clipboard

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