AWS DocumentDB data source in JetBrains DataGrip

I’m currently working on a project for Kensio Software using AWS DocumentDB, and wanted to access the database for development using DataGrip. Here are some quick notes on how to set up a DocumentDB database as a data source in DataGrip.

Getting DocumentDB connection details from AWS console

It’s probably easiest to get the connection details for the DocumentDB cluster from the AWS Console.

At the time of writing, the URL for the DocumentDB cluster looks like this:

https://console.aws.amazon.com/docdb/home/region=us-east-1#cluster-details/foobar-cluster

There’s a “Connectivity & security” tab there with connection instructions.

You’ll need to download the certificate file and put it somewhere:

wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

And then you can use the suggested mongo cli connection command to get the details you need for setting up the data source in DataGrip:

mongo --ssl \
  --host foobar-cluster.cluster-abcdef123456.us-east-1.docdb.amazonaws.com:27017 \
  --sslCAFile rds-combined-ca-bundle.pem \
  --username foobaruser \
  --password <insertYourPassword>

You’re going to use the host, port and username from here, as well as the password which you’ll need to get separately.

Setting up DocumentDB data source in DataGrip

Once you have those details, in DataGrip go to “New data source” → MongoDB.

Then you’ll need to fill in connection details on two of the tabs there.

General tab:

Leave the other fields on the General tab as they are.

SSH/SSL tab:

Leave the other fields on the SSH/SSL tab blank.

I would suggest checking the “Read-only” checkbox on the Options tab as well, at least at first.

Then you can hit “Test Connection” and you should be able to access the DocumentDB cluster as a data source in DataGrip.

By the way, you can hire me as a freelance developer to work on AWS, databases and other technologies.


Tech mentioned