I have quarkus application with an REST endpoint to upload file to S3.
With devservices by default I can see localstack container running.
I am trying to build s3client as below and the application launches fine.
public S3AsyncClient getS3Client() {
AwsBasicCredentials credentials = AwsBasicCredentials.create("test-key", "test-secret");
return S3AsyncClient.builder().credentialsProvider(StaticCredentialsProvider.create(credentials))
.endpointOverride(URI.create("http://localhost:4566"))
.region(Region.AP_SOUTH_1)
.build();
}
When the request is sent getting UnKnownHost exception.
"Received an UnknownHostException when attempting to interact with a service. See cause for the exact endpoint that is failing to resolve. If this is happening on an endpoint that previously worked, there may be a network connectivity issue or your DNS cache could be storing endpoints for too long."
Container View
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8a060b1ef175 localstack/localstack:3.0.1 "docker-entrypoint.sh" 3 minutes ago Up 3 minutes (healthy) 4510-4559/tcp, 5678/tcp, 0.0.0.0:50263->4566/tcp epic_chandrasekhar
d8fee11b5eee testcontainers/ryuk:0.6.0 "/bin/ryuk" 3 minutes ago Up 3 minutes 0.0.0.0:50261->8080/tcp testcontainers-ryuk-40638bfc-187f-4540-a786-ab1bc49e63b9
Why is it throwing unknownhost exception ?