Aws-elasticsearch-connector analog for opensearch-js?

Are there plans to make something like the aws-elasticsearch-connector available to connect to AWS ElasticSearch using the opensearch-js client? Is the answer any different for connecting to AWS OpenSearch?

Hey @Ghazgkull, welcome!

No plans I’ve heard of but taking a look at the code of that module it would be super trivial. TBH, that module could be abstracted to allow for either the elastic client or OpenSearch client.

@searchymcsearchface Thanks, Kyle. I guess more generally, do you know if there’s currently any guidance available for AWS OpenSearch customers to use the OpenSearch Javascript client? I understand that the OpenSearch JS client is supposed to be a drop-in replacement for the Elasticsearch JS client, but I don’t know how to close the authentication gap.

I don’t personally work with Amazon OpenSearch Service (while I work for AWS, I’m somewhat isolated from the services and work only on open source) so I’m not entirely familiar with what guidence you’d need to use the client.

However, the connector you’ve linked isn’t an AWS project, so I wouldn’t expect AWS to update it. Like mentioned above, these are not complex scripts - the only dependencies to the Elastic JS client are on these two lines in AmazonConnection and AmazonTransport. Swapping that dependency over to opensearch-js should solve the problem (in theory, as I haven’t personally tried it :wink: ).

I see a few options for your situation:

  1. You can appeal to the opensearch-js team to add support for signing through a feature request.
  2. Fix the aws-elasticsearch-connector - there seems to be an issue created already but no pull requests.
  3. Get rid of this library entirely in your code. There is very little going on in the library and some would be irrelevant to your situation (30% of the code in AmazonConnect.js seems to be a shim for ES 6, as an example).

Hope this helps!

1 Like

Thanks, Kyle.

I understand the importance of governing this project as an independent open source entity and the need to distance it from vendor-specific implementation details. But since cloud-provider-hosted ElasticSearch (licensing) is the raison d’etre for OpenSearch, I think it makes all the sense in the world that the OpenSearch client docs would at least include examples of how to connect to various providers. Even if those examples are buried away in some isolated “vendor” section.

I would also suggest that we look at the Kubernetes project as a good example of how to navigate this territory. Kubernetes is kept pretty vendor neutral, but it also has all the necessary hooks and plugins to support real-world vendor integration. I’d love to see OpenSearch follow a similar path.

1 Like