Connecting Robo 3T with DocumentDB outside AWS VPC.

Shubham Deshmukh
AWS Tip
Published in
3 min readMar 11, 2022

--

Connecting to AWS Version on MongoDB with a Client.

Prerequisites

  1. AWS Account
  2. DocumentDB Cluster
  3. VPC
  4. Robo 3T installed on the local machine

Overview

We will be using the EC2 instance to create a tunnel between our local machine and DocumentDB. The EC2 and DocumentDB must be in the same VPC and we must make sure that the security group for DocumentDB must have EC2 instance security group or IP in the inbound rule. This will give access to DocumentDB to the EC2 instance.

Add the inbound rule to EC2 as per your setup so that the local machine can access the EC2. If you are new, you can open the EC2 access to all protocols with the source as 0.0.0.0/0(this allows any user to access the EC2) in the inbound rules of the EC2’s security group.

Steps to Connect

  1. Open Robo 3T and choose to Create.

2. On the Connection tab, in the Address field, enter the cluster endpoint, Port as 27017, and give a name to the connection.

you can use this link to find the endpoint.

3. On the Authentication tab, check the box for Perform Authentication. Now enter the authentication information for your cluster.

4. On the SSH tab, check the box for Use SSH tunnel and add the SSH address, username, and private key/password of your EC2 instance. The SSH address is the public DNS of your EC2 instance. Add the .pem file for your EC2 instance.

5. Now choose the TLS tab and click the drop-down menu for Authentication Method. Choose Use CA Certificate. Select Advanced Options and for the Invalid Hostnames menu, select Allowed.

6. Test the connection by choosing the Test button.

7. A Diagnostic window should appear with the test results. If everything is green, then close the box.

8. Now choose Save. select your cluster and choose Connect.

Thanks for reading. I hope this story was helpful. If you are interested,

check out my other articles.

you can also visit shubhamdeshmukh.com.

--

--

Software Developer | Cloud infrastructure | IaC | AWS | DevOps | Hit the follow button for Cloud-related content 😄