MongoDB.live, free & fully virtual. Register Now MongoDB.live, free & fully virtual. Register Now

What's the best way to connect to an Atlas replica set from CI/CD servers

From our CircleCI builds, we are in need of connecting to our Atlas replica sets. We have a VPC Peering connection from our AWS VPC so my first idea was to setup a bastion host within our VPC where our CircleCI servers can SSH tunnel from, however it seems like it’s not possible to connect to a replica set via SSH tunneling from what I’ve read online. Would a VPN be the next best option? Any other suggestions?

Hi @Jason_Mattiace,

Welcome to MongoDB community!

I read that Circle CI can be installed in your AWS vpc and it can be peered to Atlas project.

Do you have another topology in mind?

Best
Pavel

Hey @Pavel_Duchovny, thanks for the reply. In order to do that we would have to get an enterprise package which we don’t want to do at this time.

Hi @Jason_Mattiace,

So if you are running outside of AWS you will need to whitelist a perminant public IP/CIDR of your Circle CI servers.

Best
Pavel

We can’t whitelist IPs since the CircleCI block is too large and open to many others. I’m looking at solutions to setup a VPN connection since SSH tunneling doesn’t seem to be an option.

Hi @Jason_Mattiace,

In that case I would recommend looking into Aws Private Link connection setup

https://docs.atlas.mongodb.com/security-private-endpoint/

Connections to private endpoints within your VPC can be made transitively from:

  • An on-premises data center connected with DirectConnect to the private endpoint-connected VPC. This enables you to connect to Atlas directly from your on-premises data center without adding public IP addresses to the Atlas IP access list.

Best
Pavel

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.