Closed sriharshakappala closed 5 years ago
I am getting the exact same error. And my code is also the exactly same. Can somebody help with this?
Ok. I figured this out. There's some problem with specifying the region. @sriharshakappala - Add this line -
const AWS = require('aws-sdk');
AWS.config.region = 'us-west-2';
I have fixed by doing in the below way. I have to use AWS.ECSCredentials
since my app is running inside ECS cluster.
const AWS = require('aws-sdk');
const config = require('../../configuration');
const elasticsearch = require('elasticsearch');
const credentials = new AWS.ECSCredentials({
httpOptions: {timeout: 5000},
maxRetries: 10,
});
const esClient = new elasticsearch.Client({
host: config.get('elasticsearch.rental.host'),
log: config.get('elasticsearch.log_level'),
connectionClass: require('http-aws-es'),
awsConfig: new AWS.Config({
region: 'us-west-2',
credentials: credentials,
}),
});
module.exports = esClient;
still not working on me
@TheDeveloper I too was facing the issue
User: anonymous is not authorized to perform: es:ESHttpPost
and found your package via Stackoverflow. Based on the findings I changed my es-client code in the below way.But now I am getting
No Living connections
. 7 hours now and still not able to figure out what's happening. Any ideas what might be going wrong?