public static String guessRegionNameForEndpoint(String hostname) {
        return guessRegionNameForEndpoint(hostname, null);
    }
Attempt to convert the provided hostname into a region name, returning null if the conversion fails.
aws-java-sdk-core/src/main/java/com/amazonaws/regions/EndpointToRegion.java