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

已提問 4 年前檢視次數 1827 次
1 個回答
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.

已回答 4 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南