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 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则