question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

how to set http-aws-es in new version elasticsearch js?

See original GitHub issue

💬 Questions and Help

Hi, I try to update elasticsearch from "elasticsearch": "^15.1.1" to "@elastic/elasticsearch": "^7.0.0-rc.1"

Here is my change for init Client

const esClient = new Client({ nodes: [ ‘someNode’ ], ConnectionPool: require(‘http-aws-es’) })

When I query the es endpoint. I got the error as below:

TypeError: Invalid host
      at HttpAmazonESConnector.ConnectionAbstract (/myLocalFolder/node_modules/elasticsearch/src/lib/connection.js:27:11)
      at HttpAmazonESConnector.HttpConnector (/myLocalFolder/node_modules/elasticsearch/src/lib/connectors/http.js:32:22)
      at HttpAmazonESConnector (/myLocalFolder/node_modules/http-aws-es/connector.js:20:5)
      at ConnectionPool.addConnection (/myLocalFolder/node_modules/@elastic/elasticsearch/lib/ConnectionPool.js:230:24)
      at opts.forEach.o (/myLocalFolder/node_modules/@elastic/elasticsearch/lib/ConnectionPool.js:211:30)
      at Array.forEach (native)
      at ConnectionPool.addConnection (/myLocalFolder/node_modules/@elastic/elasticsearch/lib/ConnectionPool.js:211:12)
      at Client (/myLocalFolder/node_modules/@elastic/elasticsearch/index.js:104:27)

is there anything missing for my change?

Please note that this issue tracker is not a help forum and this issue may be closed.

It’s not uncommon that somebody already opened an issue or in the best case it’s already fixed but not merged. That’s the reason why you should search at first before submitting a new one.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
fewsteracommented, Sep 11, 2019

We’ve released an NPM package that works with @elastic/eleasticsearch and AWS elasticsearch clusters. It signs the requests for AWS and refreshes the credentials when they’re about to expire.

https://www.npmjs.com/package/@acuris/aws-es-connection https://github.com/mergermarket/acuris-aws-es-connection

6reactions
parthdesai93commented, May 29, 2019

To anyone looking for the updated version, here is a sample gist[0] that fit our requirements. I’ll look into submitting a PR/publishing a new package when I get a bit of time.

[0] https://gist.github.com/parthdesai93/1bd3a25ad4cf788d49ce4a00a1bb3268

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update | Elasticsearch JavaScript Client [8.5] | Elastic
The update API allows updates of a specific document using the given script. ... Client } = require('@elastic/elasticsearch') const client = new Client({ ......
Read more >
node.js - How to connect to AWS ElasticSearch using npm ...
I was able to solve this by specifying the region. There is a problem with the elasticsearch client where it's not able to...
Read more >
Http-aws-es NPM - npm.io
Connection handler for Amazon ES. Makes elasticsearch-js compatible with Amazon ES. It uses the aws-sdk to make signed requests to an Amazon ES...
Read more >
aws-es - Npms.io
A tiny Amazon Signature Version 4 connection class for ... Use the elasticsearch-js client with Amazon ES (Updated for elasticsearch 16.7.2).
Read more >
ElasticSearch - npm - Socket.dev
The official low-level Elasticsearch client for Node.js and the browser. ... A tiny Amazon Signature Version 4 connection class for @elastic/elasticsearch, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found