Using Java TransportClient for access to AWS ElasticSearch instance

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.

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

1 Like

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.

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?

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.

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.

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.

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.

1 Like

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

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?

Ok, I will try it.

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