I'm trying to connect to my MongoDB Atlas cluster from a Cloudflare Worker. The cluster has IP whitelisting enabled. I added all the published Cloudflare IP ranges to the whitelist, but the Worker still can't connect.
If I remove the IP restriction in Atlas, the connection works — so it seems the Worker isn’t using the IPs listed in Cloudflare’s docs.
I even pinged the Worker and saw an IP that's within the whitelisted range, and I tried manually adding that exact IP to Atlas — still no luck.
So my question is:
How can I find out what IPs Workers use for outbound requests to whitelist in MongoDB Atlas?
Or what's the right solution to make this setup work securely?