static String resolveEcsEndpoint(AwsConfig awsConfig, String region) {
        String ecsHostHeader = awsConfig.getHostHeader();
        if (isNullOrEmptyAfterTrim(ecsHostHeader)
            || ecsHostHeader.equals("ecs")
        ) {
            ecsHostHeader = DEFAULT_ECS_HOST_HEADER;
        }
        return ecsHostHeader.replace("ecs.", "ecs." + region + ".");
    }
@Test
    public void resolveEcsEndpoints() {
        assertEquals("ecs.us-east-1.amazonaws.com", resolveEcsEndpoint(AwsConfig.builder().build(), "us-east-1"));
        assertEquals("ecs.us-east-1.amazonaws.com",
            resolveEcsEndpoint(AwsConfig.builder().setHostHeader("ecs").build(), "us-east-1"));
        assertEquals("ecs.us-east-1.something",
            resolveEcsEndpoint(AwsConfig.builder().setHostHeader("ecs.something").build(), "us-east-1"));
    }