Connect AWS elasticsearch to Django

Viewed 105

I have a django application which I succesfully linked to elasticsearch that is running on AWS.

So I created a GET API using elasticsearch_dsl and elasticsearch_dsl_drf and more

while this API now works perfectly, it only works in my localhost.
I've deployed my Django App on AWS Lambda using Zappa.

Below is how I make the connection

ELASTICSEARCH_DSL = {
    'default': {
        'hosts': 'https://myendpoint.eu-central-1.es.amazonaws.com/',
        'use_ssl': True,
        'http_auth': ('***************', '***************'),
        'connection_class': RequestsHttpConnection
    }
}

The problem that I'm getting when deployed is I get a timeout message:

{"message": "Endpoint request timed out"}

Is there any configuration I am doing wrong? or do I have to give some kind of permissions to AWS elasticsearch or AWS Lambda ?

0 Answers
Related