diff --git a/Sources/Core/AWSClientRuntime/Regions/BundleRegionProvider.swift b/Sources/Core/AWSClientRuntime/Regions/BundleRegionProvider.swift deleted file mode 100644 index df3703fe856..00000000000 --- a/Sources/Core/AWSClientRuntime/Regions/BundleRegionProvider.swift +++ /dev/null @@ -1,46 +0,0 @@ -// -// Copyright Amazon.com Inc. or its affiliates. -// All Rights Reserved. -// -// SPDX-License-Identifier: Apache-2.0 -// -import AwsCommonRuntimeKit -import ClientRuntime - -public struct BundleRegionProvider: RegionProvider { - private let logger: SwiftLogger - private let bundle: Bundle - private let regionKey: String - private let maxSizeRegion = 38 - - public init(bundle: Bundle = Bundle.main, regionKey: String = "AWS_REGION") { - self.logger = SwiftLogger(label: "BundleRegionProvider") - self.bundle = bundle - self.regionKey = regionKey - } - - public func resolveRegion() async throws -> String? { - #if os(iOS) || os(watchOS) || os(tvOS) - guard let region = region() else { - return nil - } - - if region.count > maxSizeRegion { - return String(region.prefix(maxSizeRegion)) - } else { - return region - } - #else - return nil - #endif - } - - func region() -> String? { - do { - return try BundleConfiguration.value(bundle: self.bundle, for: regionKey) - } catch { - logger.debug("\(error)") - } - return nil - } -} diff --git a/Sources/Core/AWSClientRuntime/Regions/DefaultRegionResolver.swift b/Sources/Core/AWSClientRuntime/Regions/DefaultRegionResolver.swift index 9e98e391097..7b88c4702d4 100644 --- a/Sources/Core/AWSClientRuntime/Regions/DefaultRegionResolver.swift +++ b/Sources/Core/AWSClientRuntime/Regions/DefaultRegionResolver.swift @@ -13,7 +13,6 @@ public struct DefaultRegionResolver: RegionResolver { public init(fileBasedConfigurationProvider: @escaping FileBasedConfigurationProviding) throws { self.providers = [ - BundleRegionProvider(), EnvironmentRegionProvider(), ProfileRegionProvider(fileBasedConfigurationProvider: fileBasedConfigurationProvider), try IMDSRegionProvider()