DataGrip + AWS DocumentDB - How To?

Planned

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?

4
10 comments

I am seeing exactly the same behavior.

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

`mongo --ssl --host aws-host...amazon.com:27017 --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

0

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

0

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

0

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

reference: https://youtrack.jetbrains.com/issue/DBE-10597

0

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?

 
0

You need to download the .pem, wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

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. https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/cvpn-working-endpoints.html . I also think AWS choosing .pem as an extension for a CA is rather peculiar because it can contain a secret or private key. 

0

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

 
0

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.

0

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  = https://docs.aws.amazon.com/documentdb/latest/developerguide/connect_programmatically.html#connect_programmatically-tls_disabled. But I getting the timeout error.

1

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.

0

Please sign in to leave a comment.