DataGrip + AWS DocumentDB - How To?


How do you connect DataGrip to a AWS DocumentDB (mongoDB)? Using the MongoDB driver I'm able to specify the connection and the test connect is successful but when DataGrip tries to load the schema I'm getting a `Null Pointer Exception`.

Since DocumentDB uses the older API of MongoDB I'm assuming there's some parameter or something to tell DataGrip how to connect to it?


I am seeing exactly the same behavior.

A console connection with mongo, as explained in the AWS documentation, works fine:

`mongo --ssl --host --sslCAFile rds-combined-ca-bundle.pem --username root --password <insertYourPassword>`

On Pycharm 2020.1, by using the same certificate in the `CA File` of the SSH/SSL tab, with the `Use SSL` checkbox cheked, and after a while, I get the Null Pointer exception


Same here I did not manage to get it to work and would love it if this would work.


I'm having the same issue, can't connect to my AmazonDB cluster using DataGrip please help


Carlosd Dev try updating your mongo driver, with 1.8.3 version this was fixed.



I'm using driver 1.8.3 and trying to connect to AWS DocumentDB through an EC2 machine acting as SSH tunnel, but still didn't succeed in connecting. Anyone else got this working?


You need to download the .pem, wget

Enable the checkbox for "Use SSL" and then point that to your .pem file location. Nothing else needs to be set under SSL for this to work.

PS: SSH tunnelling is a PITA. Ask your devops/infra/platf-eng/etc team to setup a proper VPN into the VPC using VPN endpoints. . I also think AWS choosing .pem as an extension for a CA is rather peculiar because it can contain a secret or private key. 


Make sure the use the latest MongDB driver (4.4.4 in my case) as I was also having issues and after JetBrains support checked, it appeared to be caused by older version of the driver


In general, you need SSH jump host (any EC2 instance), set up SSH tunnel and SSL for proper connection.

Just let me know if you need further assistance.


I have PyCharm, and I noticed that AWS DocumentDB can be easily connected with DataGrip IDE, as mentioned in the AWS documentation. Is there any way to establish a connection to our DocumentDB through PyCharm?

I use this aws documentation code in the in pycharm in my local machine  = But I getting the timeout error.


Karthikthangaraj123, do you use the database tool plugin in PyCharm to connect to your AWS DocumentDB database or is it accomplished via pymongo client as per the article above? Please provide the error message you're getting.


Please sign in to leave a comment.