I'm trying to limit connection to my MongoDB Atlas cluster from only my fly.io app. I have its IPv4 address from the app deployment page (screenshot below)
and added it to the whitelist in MongoDB Atlas (screenshot below)
The problem is that this doesn't even appear to be enough to allow a connection from my app to my cluster. Even increasing the IP range to 137.66.12.0/23
doesn't help. I've had to allow connection from anywhere in order to get my fly app to connect. I don't have this problem if I'm trying to whitelist my own laptop to develop locally.
I should clarify that performing a dig
on my app's URL does bring up the IP address in the first screenshot, so at least this confirms that the IP address is not internal to fly.io.
Can anyone explain what's happening here? Is there a way I can work around this?
Thanks in advance!