Reuse the established elasticsearch-js client with AWS signature v4. Built-in support for Typescript.
npm i @trmaphi/aws-elasticsearch-service-client @elastic/elasticsearch aws-sdk
const AWS = require('aws-sdk');
const { AWSElasticSearchClient } = require('@trmaphi/aws-elasticsearch-service-client');
AWS.config.update({
credentials: new AWS.SharedIniFileCredentials({ profile: 'YOUR LOCAL AWS PROFILE'}),
region: 'AWS REGION',
})
const client = new AWSElasticSearchClient({
node: 'URL to AWS ElasticSearch Node',
});
client.search({
index: 'Any index name',
body: { query: { match_all: {} } }
})
.then(res => console.log(res.body.hits.hits))
.catch(err => console.error(err));
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Truong Ma Phi - Initial work - trmaphi
This project is licensed under the MIT License - see the LICENSE.md file for details