DocumentDB Support


#1

Can we get DocumentDB support for the backend? It seems that connecting to DocumentDB currently errors out since the MongoDB driver will not accept the DocumentDB TLS certificates. AWS provides these CA certs: https://docs.aws.amazon.com/documentdb/latest/developerguide/security.encryption.ssl.html.


#2

Have you tested this: ?

Not sure if there is much I can do, it seems that you just have to import the certificate into your cert store.


#3

I haven’t. I’m not sure exactly how I would manage this with the Kubernetes deployment of Squidex.


#4

Might be worth to have a look at: https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/


#5

I was able to get past that issue by adding a postStart lifecycle hook:
lifecycle:
postStart:
exec:
command: ["/bin/sh", “-c”, " wget https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem; cp rds-combined-ca-bundle.pem /usr/local/share/ca-certificates/; update-ca-certificates"]

I’m now however running into this issue:
“message”: “Command createIndexes failed: namespace name generated from index name is too long.”
Any idea?


#6

The driver auto generates the names for indices based on the properties. Seems that DocumentDB does not like some of these names. So I guess I have to make a few adjustments to get it working with DocumentDB.


#7

#8

#9

Sorry, when I closed the topic I thought DocumentDB=CosmosDB


#10

Do you know how to open a connection to my DocumentDB instance from my local dev machine?


#11

You can’t directly assign a public IP to DocumentDB, but you do have a couple of options:

  1. Create a dev machine in AWS
  2. Put DocumentDB behind an ALB (In theory should work, haven’t tested)
  3. Setup an SSH tunnel with a bastion host you have in AWS that does have internet access.

For option 3: https://docs.aws.amazon.com/documentdb/latest/developerguide/connect-from-outside-a-vpc.html


#12

I am trying Option #3 but it just cannot connect without further details.


#13

I installed mongo shell on my EC2 instance but even from there I cannot connect.


#14

I got it working and the first tests look good.

Please give it a try.


#15

I’ll be able to give this a try on Tuesday and let you know.