在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:TheDeveloper/http-aws-es开源软件地址:https://github.com/TheDeveloper/http-aws-es开源编程语言:JavaScript 99.0%开源软件介绍:DeprecatedNewer version available at aws-elasticsearch-js for more recent versions of Elasticsearch and elasticsearch-js. Connection handler for Amazon ESMakes 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// create an elasticsearch client for your Amazon ES
let es = require('elasticsearch').Client({
hosts: [ 'https://amazon-es-host.us-east-1.es.amazonaws.com' ],
connectionClass: require('http-aws-es')
}); Region + CredentialsThe connector uses aws-sdk's default behaviour to obtain region + credentials from your environment. If you would like to set these manually, you can set them on aws-sdk: let AWS = require('aws-sdk');
AWS.config.update({
credentials: new AWS.Credentials(accessKeyId, secretAccessKey),
region: 'us-east-1'
}); Optionslet options = {
hosts: [], // array of amazon es hosts (required)
connectionClass: require('http-aws-es'), // use this connector (required)
awsConfig: new AWS.Config({ region }), // set an aws config e.g. for multiple clients to different regions
httpOptions: {} // set httpOptions on aws-sdk's request. default to aws-sdk's config.httpOptions
};
let es = require('elasticsearch').Client(options); Testnpm test
# test against a real endpoint
AWS_PROFILE=your-profile npm run integration-test -- --endpoint https://amazon-es-host.us-east-1.es.amazonaws.com --region us-east-1 |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论