Access to MongoDB Atlas Server

We have a MongoDB Atlas cluster that we use in our services, and would like to limit who can connect directly to the cluster using pritunl. Ideally we could just add a route to the cluster so that all the traffic going towards mongodb goes through the VPN, and just give access to the VPN instance IP, but you cant add a URL as a route. Any ideas on how to allow access to the mongodb service through the VPN? Thanks!

You can either connect the Atlas server to a local cloud VPC using the providers that MongoDB support. Than route the local IP addresses on the Pritunl server to the Atlas database. Alternatively the Atlas domains for the database can be resolved to public IP addresses and those IP addresses can be routed. You will need to select the option in Atlas to get the old version of the MongoDB URI which contains all the domains of the nodes, the newer single domain URI will resolve to multiple nodes. It’s unlikely these IP addresses will change. The Atlas database will need to be configured to allow traffic from either the public or private IP address of the Pritunl server.