Closed nihalpot closed 10 months ago
LGTM. Did you verify it fixes inside your environment?
Yup I did, I tried this specific section of code. Just sharing some code here to validate this fix:
import com.amazonaws.regions.LegacyRegionXmlMetadataBuilder
import com.amazonaws.regions.RegionMetadata
import com.amazonaws.partitions.PartitionsLoader
val newMetadata = new RegionMetadata(new PartitionsLoader().build())
val legacyMetadata = new LegacyRegionXmlMetadataBuilder().build()
println(newMetadata.tryGetRegionByEndpointDnsSuffix("msk.us-east-2.amazonaws.com")) // works
println(legacyMetadata.tryGetRegionByEndpointDnsSuffix("msk.us-east-2.amazonaws.com")) // doesn't work
LGTM much simpler and neat thanks for the PR!
Issue #, if available: Described in #127 Auth failure when connecting from cross-region to MSK and cross-cloud
Description of changes: The LegacyRegionXmlMetadataBuilder is built on the InMemoryRegionsProvider which does not implement the
tryGetRegionByEndpointDnsSuffix
method. This changes the call toRegionMetadataFactory.create()
to PartitionsLoader instead which does define that method.