Hi. I have a problem with Amazonica and Localstack
No matter what I do, I cannot get endpoint configuration into place in such a way that AWS SDK or Amazonica would like it
Any tips on how to do this?
I've tried all the usual (s3/list-buckets {:endpoint "<http://localstack-url:1234>"})
stuff already
All I get is
java.lang.IllegalStateException: S3 client with invalid S3 endpoint configured: my-localstack-domain:4566
This happens at
com.amazonaws.services.s3.AmazonS3Client.getRegion(AmazonS3Client.java:4590)
Which makes sense since Amazonica is leaving region as nil
on purpose https://github.com/mcohen01/amazonica/blob/master/src/amazonica/core.clj#L162
I however cannot create that EndpointConfiguration object myself and pass it in since Amazonica is expecting a string
Managed to hack past that with this:
(with-redefs [amazonica.core/build-client (constantly
(-> (AmazonS3ClientBuilder/standard)
(.enablePathStyleAccess)
(.withEndpointConfiguration (AwsClientBuilder$EndpointConfiguration.
(format "<http://%s:%s>" host port)
"eu-central-1"))
(.build)))]
(s3/list-buckets))
Definitely not pretty but at least now I get requests to localstack