AWS SDK for Java Migration Guide
AWS SDK for Java 2.x Migration Guide

Region Class Name Changes

This section describes the changes implemented in the SDK for Java 2.x for using the Region and Regions classes.

Region Configuration

  • Some AWS services don't have Region specific endpoints. When using those services, you must set the Region as Region.AWS_GLOBAL or Region.AWS_CN_GLOBAL.

    Region region = Region.AWS_GLOBAL;
  • com.amazonaws.regions.Regions and com.amazonaws.regions.Region classes are now combined into one class, software.amazon.awssdk.regions.Region.

Method and Class Name Mappings

The following tables map Region related classes between versions 1.11.x and 2.x of the SDK for Java. You can create an instance of these classes using the of() method.

RegionMetadata regionMetadata = RegionMetadata.of(Region.US_EAST_1);

Regions class method changes

1.11.x 2.x

Regions.fromName

Region.of

Regions.getName

Region.id

Regions.getDescription

Not Supported

Regions.getCurrentRegion

Not Supported

Regions.DEFAULT_REGION

Not Supported

Regions.name

Not Supported

Region class method changes

1.11.x 2.x

Region.getName

Region.id

Region.hasHttpsEndpoint

Not Supported

Region.hasHttpEndpoint

Not Supported

Region.getAvailableEndpoints

Not Supported

Region.createClient

Not Supported

RegionMetadata class method changes

1.11.x 2.x
RegionMetadata.getName RegionMetadata.name
RegionMetadata.getDomain RegionMetadata.domain
RegionMetadata.getPartition RegionMetadata.partition

ServiceMetadata class method changes

1.11.x 2.x
Region.getServiceEndpoint ServiceMetadata.endpointFor(Region)
Region.isServiceSupported ServiceMetadata.regions().contains(Region)