R
Railwayβ€’14mo ago
Posho

Obtaining Container IP for Database Whitelist

Hello there, πŸ™‚ I'm having a very similar issue as: https://discord.com/channels/713503345364697088/1149860779923865741/1149860779923865741 Only difference is that my code (and Railway) works fine, but only when the MongoDB Atlas cluster allows connectivity with all IPs (0.0.0.0/0). However, due to security reasons, that can not be the case when I set it to production. Is there any way to retrieve a static IP from the container? My guess is no (at least not without some netwrok trickery), but I wanted to ask nonetheless. πŸ€” If it helps, my script is merely a finite (a.k.a. not a server) Docker container that runs with CronJob. Thank you for the attention!
Solution:
and id like to note railway runs on gcp not aws https://utilities.up.railway.app/cidr-list?value=us-west1...
Jump to solution
8 Replies
Percy
Percyβ€’14mo ago
Project ID: b6b776da-c08a-4a43-bf75-b22793bdc0cd
Posho
Poshoβ€’14mo ago
b6b776da-c08a-4a43-bf75-b22793bdc0cd Looking for previous questions, it seems that whitelisting all of AWS's IPs is a not very optimal but serviceable solution. https://discord.com/channels/713503345364697088/1093219410954694789/1093220733414559755 What I would like to know is that if the case is still for US-West-1 region.
Brody
Brodyβ€’14mo ago
deployments on railway have dynamic ips and right now railway doesn't offer static ips
Solution
Brody
Brodyβ€’14mo ago
and id like to note railway runs on gcp not aws https://utilities.up.railway.app/cidr-list?value=us-west1
Posho
Poshoβ€’14mo ago
Oh hey, you're the same one who replied on that other thread. πŸ™‚ Yeah, I figured as much, no static IPs (yet). I added all those 27 IPs to the MongoDB Atlas whitelist (I just hope no one tries brute-forcing into the cluster from a GCP bot or server πŸ˜… ) and my script runs fine. So I can use this bandaid solution until I figure out how to implement a proper proxy. Thank you very much for that link. It will be really useful for future lookups. πŸ‘Œ
Brody
Brodyβ€’14mo ago
you used the cidr ranges and not just the ips right? and to be honest i did not think atlas would accept 27 whitelist values, thats very good to know another thing id like to note, when railway does offer static ips, they would likely be limited to the pro plan as an add on, since railway would have to purchase a whole ip block themselves
Posho
Poshoβ€’14mo ago
I punched them into the Network Access whitelisting as ranges (i.e. 34.168.0.0/15). That's perfectly reasonable and wouldn't think twice to upgrade if such a feature would come out. My whole world stops when I receive a Railway changelog email, you guys are saviors.
Brody
Brodyβ€’14mo ago
i dont work for railway, but i appreciate the kind words all the same ❀️
Want results from more Discord servers?
Add your server