DefaultRegionProviderChain

expect class DefaultRegionProviderChain(platformProvider: PlatformProvider = PlatformProvider.System, imdsClient: Lazy<InstanceMetadataProvider> = lazy { ImdsClient() }, profile: LazyAsyncValue<AwsProfile> = asyncLazy { loadAwsSharedConfig(platformProvider).activeProfile }) : RegionProvider, Closeable

RegionProvider that looks for region in this order:

  1. Check aws.region system property (JVM only)

  2. Check the AWS_REGION environment variable (JVM, Node, Native)

  3. Check the AWS config files/profile for region information

  4. If running on EC2, check the EC2 metadata service for region

Constructors

Link copied to clipboard
expect constructor(platformProvider: PlatformProvider = PlatformProvider.System, imdsClient: Lazy<InstanceMetadataProvider> = lazy { ImdsClient() }, profile: LazyAsyncValue<AwsProfile> = asyncLazy { loadAwsSharedConfig(platformProvider).activeProfile })
actual constructor(platformProvider: PlatformProvider, imdsClient: Lazy<InstanceMetadataProvider>, profile: LazyAsyncValue<AwsProfile>)
actual constructor(platformProvider: PlatformProvider, imdsClient: Lazy<InstanceMetadataProvider>, profile: LazyAsyncValue<AwsProfile>)

Functions

Link copied to clipboard
open override fun close()
open override fun close()
Link copied to clipboard
open suspend override fun getRegion(): String?

Return the region name to use. If region information is not available, implementations should return null

Inherited functions

Link copied to clipboard
expect abstract fun close()
Link copied to clipboard
abstract suspend fun getRegion(): String?

Return the region name to use. If region information is not available, implementations should return null

abstract suspend fun getRegion(): String?

Return the region name to use. If region information is not available, implementations should return null