- 1 Minute to read
-
Print
-
DarkLight
-
PDF
MongoDB Atlas Connection
- 1 Minute to read
-
Print
-
DarkLight
-
PDF
Create MongoDB Atlas Connection
Step 1 - Whitelist Rivery's IP's In Your Mongo Instance
1.In your MongoDB Atlas account - Go to Network Access and Click on Add IP Adresses
2.Whitelist the following IP's in your Mongo Instance -
After Whitelisting the IP's, the outcome result will be the following -
Connect to Mongo Atlas using Private Endpoint (Optional)
-
Under Database Network, choose Private Endpoint and click on Add Private Endpoint:
-
On Cloud Provider - Choose AWS and click Next
-
Choose Region.
Rivery supports PrivateLink in the next regions:
On console.rivery.io:
- us-east-1
- us-east-2
- us-west-2
On eu-west-1.console.rivery.io - eu-west-1
- eu-central-1
-
Wait for a while until the endpoint will be available, and a green v is shown up.
After that, copy the command aside, and get the--service-name
value:
-
Provide the
service-name
to your Rivery Account Manager or to the Support team. In this step, Rivery internally will make a handshake with your Mongo Atlas Private Endpoint, and should provide you a VPC-Endpoint-ID, with the next format:vpce-XXXXXXXXXXXXXXX
-
Paste the VPC Endpoint ID in the right place and click on Create:
Step 2 - Retrieve A Connection String
- In your MongoDB Atlas account - Go to Databases, choose your database and Click on Connect
-
If Private Endpoint created on Step 1, choose Private Endpoint as connection method, and also choose the Private Endpoint you've created on Step 1:
-
Then, select Connect your application
-
Lastly, copy the URL shown in the screen, and paste aside.
And Change the <username>
and <password>
to {username}
and {password}
and change the MyFirstDatabase to the database name you want to connect to:
Step 3 - Setting-Up The Connection At The Rivery Console
- In Rivery, go to Connections - > New Connection
- Choose MongoDB from the sources
- Give a name to your connection.
- Entre your Atlas Username and Password
-
Next, Build the connection URI: by clicking on Edit and paste the URI changed in Step 2.
4.Press on the "v" to save the URI -
5.(optinal) In case you want to change your DataBase dynamically, add the Database name to the dedicated field above the connection URI, and use the {database} variable in the the connection itself -
-
Test your credentials by pressing Test Connection
-
Save your connection