This repository has been archived by the owner on Mar 18, 2024. It is now read-only.
signed-aws-es-fetch
/
2.0.0
signed-aws-es-fetch 2.0.0
Install from the command line:
Learn more about npm packages
$ npm install @financial-times/signed-aws-es-fetch@2.0.0
Install via package.json:
"@financial-times/signed-aws-es-fetch": "2.0.0"
About this version
npm install signed-aws-es-fetch
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
andES_AWS_SECRET_ACCESS_KEY
environment variables, or - Set
AWS_ACCESS_KEY
andAWS_SECRET_ACCESS_KEY
environment variables, or - Set the
ES_AWS_SESSION_TOKEN
orAWS_SESSION_TOKEN
environment variables. If you don't want this to be automatically picked up (for example in a Lambda where theAWS_SESSION_TOKEN
may reflect an assumed role), setES_AWS_SESSION_TOKEN
tofalse
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.
Details
- signed-aws-es-fetch
- Financial-Times
- over 2 years ago
- 4 dependencies
Assets
- signed-aws-es-fetch-2.0.0-npm.tgz
Download activity
- Total downloads 1
- Last 30 days 0
- Last week 0
- Today 0