aws-lambda-elasticsearch

Access an Elasticsearch service from AWS Lambda ported from http-aws-es. Make aws-sdk a dev dependency and changes how credentials are accessed.

Usage no npm install needed!

<script type="module">
  import awsLambdaElasticsearch from 'https://cdn.skypack.dev/aws-lambda-elasticsearch';
</script>

README

HttpAmazonESConnector

A Connection handler for Amazon ES.

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.

Ported from: https://www.npmjs.com/package/http-aws-es

Param Type Description
client Object The options object passed to the Client class
client.connectionClass Class The new connection class aws-lambda-elasticsearch
[client.amazonConfig] Object Specify Amazon specific configuration
[client.amazonConfig.region] String The region of the search cluster. Falls back to process.env.AWS_REGION or 'us-east-1'

Example

var es = require('elasticsearch').Client({
 hosts: 'https://amazon-es-host.us-east-1.es.amazonaws.com',
 connectionClass: require('aws-lambda-elasticsearch'),
 amazonConfig: {
   region: 'us-east-1'
 }
});