Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making a signed HTTP request to AWS Elasticsearch in Python

I'm trying to make a simple Python Lambda that makes snapshots of our Elasticsearch database. This is done through Elasticsearch's REST API using simple HTTP requests.

However, for AWS, I have to sign these requests. I have a feeling it can be achieved through boto3's low-level clients probably with generate_presigned_url, but I cannot for the life of me figure out how to invoke this function correctly. For example, what are the valid ClientMethods? I've tried ESHttpGet but to no avail.

Can anyone point me in the right direction?

like image 889
Alec Avatar asked Jul 01 '16 11:07

Alec


1 Answers

There are several Python extensions to the requests library that will perform the SigV4 signing for you. I have used this one and it works well.

like image 196
garnaat Avatar answered Sep 24 '22 15:09

garnaat