public DefaultServiceEndpointBuilder withRegion(Region region) {
        if (region == null) {
            throw new IllegalArgumentException("Region cannot be null");
        }
        this.region = region;
        return this;
    }
Uses region metdata to construct an endpoint for a specific service
aws-java-sdk-core/src/main/java/com/amazonaws/internal/DefaultServiceEndpointBuilder.java