I am facing a weird issue. I have MongoDB installed and working on a project on an EC2 instance. I tried to access the DB from local it is working fine. But, when I try to execute my AWS lambda function I get a timeout error.
I set bindIp=0.0.0.0 for testing purpose in /etc/mongod.conf file
I have set inbound and outbound setting on EC2 as follow->
I am getting following error (from cloudwatch)
UnhandledPromiseRejectionWarning: MongoNetworkError: connection timed out
UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) 2019-11-22T13:16:14.173Z 216be03a-2280-4478-8051-060313fbca9b (node:1) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. I