JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 28303
  • Score
    100M100P100Q140690F
  • License MIT

Use the elasticsearch-js client with Amazon ES

Package Exports

  • http-aws-es
  • http-aws-es/node6

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (http-aws-es) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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 endpoint.

Installation

# Install the connector, elasticsearch client and aws-sdk
npm install --save http-aws-es aws-sdk elasticsearch

Usage

// configure the region for aws-sdk
let AWS = require('aws-sdk');
AWS.config.update({ region: 'us-east-1' });

// create an elasticsearch client for your Amazon ES
var es = require('elasticsearch').Client({
  hosts: [ 'https://amazon-es-host.us-east-1.es.amazonaws.com:80' ],
  connectionClass: require('http-aws-es')
});

Credentials

The connector uses aws-sdk's default credential behaviour to obtain credentials from your environment. If you would like to set credentials manually, you can set them on aws-sdk:

AWS.config.update({
  credentials: new AWS.Credentials(accessKeyId, secretAccessKey)
});

Test

npm run test -- --endpoint https://amazon-es-host.us-east-1.es.amazonaws.com:80 --region us-east-1