Found the solution for me. Each time I destroyed then again spun up my Lambda using Terraform, the IP would change. Getting that IP on my MongoDB Atlas allow list solved the problem. I did not have to use older PyMongo and Motor versions.
1 Like