Git Product home page Git Product logo

aws-elasticsearch-connector's Introduction

aws-elasticsearch-connector

Build Status Code Climate Test Coverage Dependency Status Download Status

A tiny Amazon Signature Version 4 connection class for the official Elasticsearch Node.js client, for compatibility with AWS Elasticsearch and IAM authentication.

For legacy Elasticsearch.js 16.x support, use version 7.x of this library.

Installation

npm install --save aws-elasticsearch-connector @elastic/elasticsearch aws-sdk

Example usage

With specific credentials

const { Client } = require('@elastic/elasticsearch');

const client = new Client({
  node: 'my-elasticsearch-cluster.us-east-1.es.amazonaws.com'
  Connection: require('aws-elasticsearch-connector'),
  awsConfig: {
    credentials: {
      accessKeyId: 'foo',
      secretAccessKey: 'bar',
      sessionToken: 'baz' // optional
    }
  }
});

With credentials from AWS.Config

const AWS = require('aws-sdk');
const { Client } = require('@elastic/elasticsearch');

// Load AWS profile credentials
AWS.config.update({
  profile: 'my-profile'
});

const client = new Client({
  node: 'my-elasticsearch-cluster.us-east-1.es.amazonaws.com'
  Connection: require('aws-elasticsearch-connector')
});

With credentials from the environment

AWS_ACCESS_KEY_ID=foo      # alias: AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY=bar  # alias: AWS_SECRET_KEY
AWS_SESSION_TOKEN=baz
const { Client } = require('@elastic/elasticsearch');

const client = new Client({
  node: 'my-elasticsearch-cluster.us-east-1.es.amazonaws.com'
  Connection: require('aws-elasticsearch-connector'),
});

Test

npm test

# Run integration tests against a real endpoint
AWS_PROFILE=your-profile npm run test:integration -- \
  --endpoint https://amazon-es-host.us-east-1.es.amazonaws.com

aws-elasticsearch-connector's People

Contributors

buildbreakdo avatar compwright avatar dougmoscrop avatar ef4 avatar improved-broccoli avatar laurie-qlik avatar subodhkhanduri1 avatar thedeveloper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.