public Region getRegion() {
            if (regionName != null) {
                return RegionUtils.getRegion(regionName);
            }

            return region;
        }
Attempt to convert the provided hostname and service hint into a region, returning null if the conversion fails.
aws-java-sdk-core/src/main/java/com/amazonaws/regions/EndpointToRegion.java