public URI getEndpointOverride(EnabledService service) {
        try {
            final String address = getHost();
            String ipAddress = address;
            // resolve IP address and use that as the endpoint so that path-style access is automatically used for S3
            ipAddress = InetAddress.getByName(address).getHostAddress();
            return new URI("http://" + ipAddress + ":" + getMappedPort(getServicePort(service)));
        } catch (UnknownHostException | URISyntaxException e) {
            throw new IllegalStateException("Cannot obtain endpoint URL", e);
        }
    }
Provides an endpoint override that is preconfigured to communicate with a given simulated service.
The provided endpoint override should be set in the AWS Java SDK v2 when building a client, e.g.:
<pre><code>S3Client s3 = S3Client
             .builder()
             .endpointOverride(localstack.getEndpointOverride(LocalStackContainer.Service.S3))
             .credentialsProvider(StaticCredentialsProvider.create(AwsBasicCredentials.create(
             localstack.getAccessKey(), localstack.getSecretKey()
             )))
             .region(Region.of(localstack.getRegion()))
             .build()
             </code></pre>
<p><strong>Please note that this method is only intended to be used for configuring AWS SDK clients
that are running on the test host. If other containers need to call this one, they should be configured
specifically to do so using a Docker network and appropriate addressing.</strong></p>

@param service the service that is to be accessed
@return an {@link URI} endpoint override
modules/localstack/src/main/java/org/testcontainers/containers/localstack/LocalStackContainer.java