Skip to content

Commit c2a39e4

Browse files
committed
Migrate GlueSchemaRegistryConnectionProperties from SDK v1 Regions to v2
Replace com.amazonaws.regions.Regions (v1) with software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain (v2) for region resolution in integration tests.
1 parent e8fe2d9 commit c2a39e4

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

integration-tests/src/test/java/com/amazonaws/services/schemaregistry/integrationtests/properties/GlueSchemaRegistryConnectionProperties.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,19 @@
1313
* limitations under the License.
1414
*/
1515
package com.amazonaws.services.schemaregistry.integrationtests.properties;
16-
import com.amazonaws.regions.Regions;
16+
17+
import software.amazon.awssdk.regions.providers.DefaultAwsRegionProviderChain;
1718

1819
public interface GlueSchemaRegistryConnectionProperties {
1920
// Glue Service Endpoint
20-
String REGION = Regions.getCurrentRegion() == null ? "us-east-2" : Regions.getCurrentRegion().getName().toLowerCase();
21+
String REGION = resolveRegion();
2122
String ENDPOINT = String.format("https://glue.%s.amazonaws.com", REGION);
23+
24+
static String resolveRegion() {
25+
try {
26+
return new DefaultAwsRegionProviderChain().getRegion().id();
27+
} catch (Exception e) {
28+
return "us-east-2";
29+
}
30+
}
2231
}

0 commit comments

Comments
 (0)