I have my MongoDB living on AWS EC2, and my Lambda function (python code) is trying to access it through the IP address 23.23.23.23:27017. At our company, we restrict our EC2 instances to our company IP address by configuring AWS security groups on an EC2 instance. The problem is that you are not sharing port 27017 with all the traffic in my EC2 instance security groups. My lambda will not be able to access it, because we do not know the IP address on which Lambda is running.
Is there a better way to access the ports of EC2 instances from AWS, such as Lambda, without breaking security rules?
source
share