Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Region changes - AWS SDK for Java 2.x

Region changes

This section describes the changes implemented in the AWS 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.x and 2.x of the AWS SDK for Java. You can create an instance of these classes using the of() method.

RegionMetadata regionMetadata = RegionMetadata.of(Region.US_EAST_1);
1.x Regions class method changes
1.x 2.x

Regions.fromName

Region.of

Regions.getName

Region.id

Regions.getDescription

Region.metadata().description()

Regions.getCurrentRegion

Not Supported

Regions.DEFAULT_REGION

Not Supported

Regions.name

Region.id

1.x Region class method changes
1.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.x 2.x

RegionMetadata.getName

RegionMetadata.name

RegionMetadata.getDomain

RegionMetadata.domain

RegionMetadata.getPartition

RegionMetadata.partition

ServiceMetadata class method changes
1.x 2.x

Region.getServiceEndpoint

ServiceMetadata.endpointFor(Region)

Region.isServiceSupported

ServiceMetadata.regions().contains(Region)

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.