All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jvmMain.aws.sdk.kotlin.runtime.region.DefaultRegionProviderChainJVM.kt Maven / Gradle / Ivy

There is a newer version: 1.3.76
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */

package aws.sdk.kotlin.runtime.region

import aws.sdk.kotlin.runtime.config.imds.InstanceMetadataProvider
import aws.sdk.kotlin.runtime.config.profile.AwsProfile
import aws.smithy.kotlin.runtime.io.Closeable
import aws.smithy.kotlin.runtime.util.LazyAsyncValue
import aws.smithy.kotlin.runtime.util.PlatformProvider

public actual class DefaultRegionProviderChain actual constructor(
    platformProvider: PlatformProvider,
    imdsClient: Lazy,
    profile: LazyAsyncValue,
) : RegionProvider,
    Closeable,
    RegionProviderChain(
        JvmSystemPropRegionProvider(platformProvider),
        EnvironmentRegionProvider(platformProvider),
        ProfileRegionProvider(profile),
        ImdsRegionProvider(client = imdsClient, platformProvider = platformProvider),
    ) {

    override fun close() {
        providers.forEach { provider ->
            if (provider is Closeable) provider.close()
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy