Using Java TransportClient for access to AWS ElasticSearch instance


(Josef Hák) #1

Hi,

Is it possible to use Java TransportClient when using AWS ElasticSearch instance and access token? Where can I find documentation for that, please?

Thanks for any advice.


(David Pilato) #2

No but cloud.elastic.co which runs on AWS supports it.


(Josef Hák) #3

I have my own AWS Elasticsearch instance. From Python I connect it using generated access token. Python package "elasticsearch==5.4.0" has support for it. I need to choose good Java solution. I successfully connected to local ES instance from both Java TransportClient and Java REST. But I don't know how to connect to AWS instance where using of access token is needed.


(David Pilato) #4

If you are running your own ES instance, what does "access token" mean?
There is nothing like this in elasticsearch by default.

Are you using x-pack to secure your elasticsearch instance?


(Josef Hák) #5

Access token is used when connecting to AWS Elasticsearch instance only. When I connect to my local instance, no access token is used. I don't know which Java client should I use when connecting to AWS Elasticsearch instance. I don't use x-pack, because it's for elasticsearch installation. It's not my case. Thanks.


(Christian Dahlqvist) #6

As far as I know, the AWS Elasticsearch service (if this is what you are using) does not support the transport protocol, which means that you will need to use a REST based Java client. The Python client works as it is REST based.


(Josef Hák) #7

I think so too. But I can't find full documentation of Java REST API. It's not contained in org.elasticsearch javadoc: https://www.javadoc.io/doc/org.elasticsearch/elasticsearch/5.4.3. Example of using with AWS is also missed here:
https://www.elastic.co/guide/en/elasticsearch/client/java-rest/5.4/_example_requests.html.


(David Pilato) #8

This is what the Java REST Client supports for authentication: https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/_basic_authentication.html

It's fully compatible with cloud.elastic.co.


(Josef Hák) #9

I don't need connect to cloud.elastic.co, but to Amazon Web Services Elasticsearch.


(David Pilato) #10

I hear you.

If the official client does not work with whatever other non official provider, then you probably need to ask this provider for advices.

I can tell you that this client works fine with:

  • Local instances
  • cloud.elastic.co instances
  • Own deployed instances on whatever cloud provider, such as AWS, GCP, Azure...

And probably some others.

May I suggest that you ask your question on AWS forums and eventually update this thread so others will know what is needed to be done?


(Josef Hák) #11

Ok, I will try it.


(system) #12

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.