I was wondering if anyone has any experience with using the AWS API Gateway as a proxy for Elasticsearch queries.
I have a few queries that I'd like to reuse and grab from a web application, so for simplicity it would be good to have an GET endpoint that can return that hard coded request from elasticsearch without requiring a running any further code to do the work.
Perhaps mapping query strings through as variables would allow specific areas within the query strings to be set to further manipulate the returned data.
The AWS API Gateway allows you to set mapping templates, which I think could be used to do this but I'm just not sure where to start here.
I can't find anything like this on the internet so any help would be appreciated.
catch-all path variables and the ANY http method let you create a "proxy" API without defining the entire structure. The proxy integrations for HTTP and Lambda functions allow you pass through an entire request and response to the backend endpoint.
If you wanted your API to mimc the exact structure of the ES APIs then you should be able to achieve this with an HTTP proxy integration. If you wanted to change the structure of the API then I would recommend using a Lambda function in-between. Configuring the backend as a proxy integration means you don't have to declare all of the possible parameters in API Gateway.
I was hoping to avoid using the lambda intermediary but it's looking more like that's gonna be the way to go. If only you could write pre-scripted queries on ES and hit them with a nice clean GET with query strings.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.