This package has been deprecated

Author message:

Retired

@foko/http-aws-es

1.1.6 • Public • Published

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. Define the Amazon ES config and the connection handler in the client configuration:

var es = require('elasticsearch').Client({
  hosts: 'https://amazon-es-host.us-east-1.es.amazonaws.com',
  connectionClass: require('http-aws-es'),
  amazonES: {
    region: 'us-east-1',
    accessKey: 'AKID',
    secretKey: 'secret'
  }
});

Pre-configured credentials can be fetched automatically (through AWS's getCredentials function) by specifying getCredentials: true in the amazonES object in place of accessKey and secretKey.

Alternatively you can pass in your own AWS Credentials object. This is particularly useful if running on AWS Lambda, since the appropriate credentials are already in the environment.

var myCredentials = new AWS.EnvironmentCredentials('AWS'); // Lambda provided credentials
var es = require('elasticsearch').Client({
  hosts: 'https://amazon-es-host.us-east-1.es.amazonaws.com',
  connectionClass: require('http-aws-es'),
  amazonES: {
    region: "us-east-1",
    credentials: myCredentials
  }
});

Dependents (0)

Package Sidebar

Install

npm i @foko/http-aws-es

Weekly Downloads

0

Version

1.1.6

License

MIT

Unpacked Size

15.5 kB

Total Files

9

Last publish

Collaborators

  • fokodeploy
  • cmcdonald
  • vinnyfoko
  • zketchum-foko
  • fokopratik
  • mbaroni
  • arbourd