private Region createNewRegion(String regionName) {
        for (Partition p : partitionMap.values()) {
            if (p.hasRegion(regionName)) {
                return cacheRegion(new PartitionRegionImpl(regionName, p));
            }
        }
        // If we can't match the regex with any partition then assume the AWS partition if it's available.
        Partition awsPartition = partitionMap.get("aws");
        if (awsPartition != null) {
            return cacheRegion(new PartitionRegionImpl(regionName, awsPartition));
        } else {
            return null;
        }
    }
Region metadata provider based on partitions.
aws-java-sdk-core/src/main/java/com/amazonaws/partitions/PartitionMetadataProvider.java