static void validateRegion(String region) {
        if (region == null) {
            throw new InvalidConfigurationException("The provided region is null.");
        }
        if (!AWS_REGION_PATTERN.matcher(region).matches()) {
            String message = String.format("The provided region %s is not a valid AWS region.", region);
            throw new InvalidConfigurationException(message);
        }
    }
@Test
    public void validateInvalidRegion() {
        // given
        String region = "us-wrong-1";
        String expectedMessage = String.format("The provided region %s is not a valid AWS region.", region);

        //when
        ThrowingRunnable validateRegion = () -> RegionValidator.validateRegion(region);

        //then
        InvalidConfigurationException thrownEx = assertThrows(InvalidConfigurationException.class, validateRegion);
        assertEquals(expectedMessage, thrownEx.getMessage());
    }