1

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 ?

1
  • Is the AWS Elasticsearch service configured to run in a VPC? If so, does the security group allow your app to access it? Are you using IAM authentication on the Elasticsearch service? There are many ways the configuration of Elasticsearch, or your VPC configuration, could be causing this timeout, but you haven't included details about any of that in your question. Commented Jun 3, 2022 at 13:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.