This package has been deprecated

Author message:

This package is no longer supported

signed-aws-es-fetch

1.6.0 • Public • Published

signed-aws-es-fetch

Install

npm install signed-aws-es-fetch

Usage

For credentials either:-

  • Specify them in the following format as the third argument to signedFetch:-
signedFetch(url, opts, { accessKeyId: ???, secretAccessKey: ??? });
  • Or, set ES_AWS_ACCESS_KEY and ES_AWS_SECRET_ACCESS_KEY environment variables, or
  • Set AWS_ACCESS_KEY and AWS_SECRET_ACCESS_KEY environment variables, or
  • Set the ES_AWS_SESSION_TOKEN or AWS_SESSION_TOKEN environment variables. If you don't want this to be automatically picked up (for example in a Lambda where the AWS_SESSION_TOKEN may reflect an assumed role), set ES_AWS_SESSION_TOKEN to false to disable this.
const signedFetch = require('signed-aws-es-fetch');
 
signedFetch(`https://${HOSTNAME_OF_ELASTIC_CLUSTER}/${INDEX}/_search`, {
        method: 'POST',
        body: JSON.stringify()
    })
    .then(function(response) {
        return response.json();
    });

To disable DNS resolution for domains outside of es.amazonaws.com you can use the AWS_SIGNED_FETCH_DISABLE_DNS_RESOLUTION environment variable.

Readme

Keywords

none

Package Sidebar

Install

npm i signed-aws-es-fetch

Weekly Downloads

225

Version

1.6.0

License

none

Unpacked Size

3.98 kB

Total Files

5

Last publish

Collaborators

  • aendra
  • alexwilson
  • chee
  • emmalewis
  • hamza.samih
  • notlee
  • robertboulton
  • rowanmanning
  • seraph2000
  • the-ft