Giter Site home page Giter Site logo

wooodhead / aws-elasticsearch-connector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from compwright/aws-elasticsearch-connector

0.0 1.0 0.0 452 KB

A tiny Amazon Signature Version 4 connection class for Elasticsearch.js

Home Page: https://www.npmjs.com/package/aws-elasticsearch-connector

License: MIT License

JavaScript 100.00%

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.

Supports AWS SDK global or specific configuration instances (AWS.Config), including asyncronous credentials from IAM roles and credential refreshing.

Installation

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

Example usage

Using global configuration

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

// (Optional) load profile credentials from file
AWS.config.update({
  profile: 'my-profile'
})

const client = new Client({
  ...createAwsElasticsearchConnector(AWS.config),
  node: 'https://my-elasticsearch-cluster.us-east-1.es.amazonaws.com'
})

Using specific configuration

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

const awsConfig = new AWS.Config({
  // Your credentials and settings here, see
  // https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Config.html#constructor-property
})

const client = new Client({
  ...createAwsElasticsearchConnector(awsConfig),
  node: 'https://my-elasticsearch-cluster.us-east-1.es.amazonaws.com'
})

Test

npm test

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

aws-elasticsearch-connector's People

Contributors

amarczinek avatar buildbreakdo avatar compwright avatar dougmoscrop avatar ef4 avatar improved-broccoli avatar jbasiglio avatar katryo avatar laurie-qlik avatar nathanmoon avatar osdroid avatar subodhkhanduri1 avatar thedeveloper avatar umberto-sonnino avatar

Watchers

 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.