code: protected String parseAzToGetRegion(String availabilityZone) {
          // Here we see that whether the availability zone is following a pattern like <region><single letter>
          // If it is then we take ignore the last letter and check if the remaining part is actually a known remote
          // region. If yes, then we return that region, else null which means local region.
          if (!availabilityZone.isEmpty()) {
              String possibleRegion = availabilityZone.substring(0, availabilityZone.length() - 1);
              if (availabilityZoneVsRegion.containsValue(possibleRegion)) {
                  return possibleRegion;
              }
          }
          return null;
      }
docs: Tries to determine what region we're in, based on the provided availability zone.
  @param availabilityZone the availability zone to inspect
  @return the region, if available; null otherwise