0

I'm using Amazon Elasticsearch Service. I need to authenticate it with the access_key_id and secret_access_key. I saw some aws-sdk available for this service but I need to access the URL in terminal. Something similar to this.

curl -H "Authorization: ApiKey VnVhQ2ZHY0JDZGJrUW0tZTVhT3g6dWkybHAyYXhUTm1zeWFrdzl0dk5udw==" http://localhost:9200/_cluster/health

Is it possible?

Guru
  • 411
  • 3
  • 20
  • Are you using a lambda function ? – Amit Baranes Dec 02 '19 at 10:41
  • No @AmitBaranes – Guru Dec 02 '19 at 10:53
  • I guess the easiest way for you would be use postman as it has inbuilt support for AWS authentication method. Just provide the keys and it will create the necessary header for siging the request. From curl it is not straight forward as you will need to calculate the signature by yourself. see this https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html If you could use nodejs, then you could use `aws-sdk` and `http-aws-es` togather to sign all your requests. Also worth looking https://github.com/joona/aws-es-curl – Ashish Modi Dec 05 '19 at 19:55
  • @AshishModi Thanks Ashish. I will look at it and will let you know. – Guru Dec 06 '19 at 12:47

0 Answers0