lambda function always timing out when connecting to AWS Elasticsearch

0

I have created an elastic search domain VPC mode and put the lambda function in the same VPC and even the same subnet along with the same security group with free access in all ports.
I have given all the permissions like : AWSLambdaVPCAccessExecutionRole,elasticSearchPolicyinline Policy ,CloudWatchLogsFullAccess,AWSLambdaBasicExecutionRole but my lambda function is still timing out for a single document 60 seconds timeout. Do anybody know how to correct this?

Edited by: sagarRsys on Nov 26, 2019 6:27 AM

gefragt vor 4 Jahren1827 Aufrufe
1 Antwort
0

The thing was error wasn't actualy in Elasticsearch part. My s3 access code and elasticsearch access code were tied up. Initially, s3 part was running fine due to lambda having default access to internet. However when i introduced elasticsearch, i put my lambda in vpc. During this time, I forgot that s3 code lost access to s3 storage. So when i ran the code and it was timing out, I assumed it was due to Elasticsearch. After hours of digging, I realized my error. The solution was to create Vpc endpoint for s3 service in that region and put it in the route table. elasticsearch was running fine.

beantwortet vor 4 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen