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

commonMain.aws.sdk.kotlin.runtime.config.endpoints.Endpoints.kt Maven / Gradle / Ivy

/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
package aws.sdk.kotlin.runtime.config.endpoints

import aws.sdk.kotlin.runtime.InternalSdkApi
import aws.sdk.kotlin.runtime.config.AwsSdkSetting
import aws.sdk.kotlin.runtime.config.profile.*
import aws.smithy.kotlin.runtime.config.resolve
import aws.smithy.kotlin.runtime.util.LazyAsyncValue
import aws.smithy.kotlin.runtime.util.PlatformProvider
import aws.smithy.kotlin.runtime.util.asyncLazy

/**
 * Attempts to resolve the enabled state of FIPS endpoints from the environment.
 */
@InternalSdkApi
public suspend fun resolveUseFips(
    provider: PlatformProvider = PlatformProvider.System,
    profile: LazyAsyncValue = asyncLazy { loadAwsSharedConfig(provider).activeProfile },
): Boolean? =
    AwsSdkSetting.AwsUseFipsEndpoint.resolve(provider)
        ?: profile.get().useFips

/**
 * Attempts to resolve the enabled state of dual-stack endpoints from the environment.
 */
@InternalSdkApi
public suspend fun resolveUseDualStack(
    provider: PlatformProvider = PlatformProvider.System,
    profile: LazyAsyncValue = asyncLazy { loadAwsSharedConfig(provider).activeProfile },
): Boolean? =
    AwsSdkSetting.AwsUseDualStackEndpoint.resolve(provider)
        ?: profile.get().useDualStack




© 2015 - 2025 Weber Informatics LLC | Privacy Policy