How to set MONGO_URL using AWS Document DB

Hi Everyone,

I configured the Document DB & its working from the terminal. It’s SSL secure and I have key file(.pem) of that as well.

I wanted to connect my Meteor Project using the specified string, I tried using the exact same String which was there from Document DB panel but that does not work.

Looked for this, found that it can be configured using the settings.json.

So, created a file settings.json have the following content

{
"packages": {
    "mongo": {
      "options": {
        "ssl": true,
        "ssl_ca_certs": "rds-combined-ca-bundle.pem",
        "replicaSet": "rs0",
        "readPreference": "secondaryPreferred",
        "retryWrites": false
      }
    }
  }	
}

Getting error as

Also, checked docs, this is mentioned there

"packages": {
    "mongo": {
      "options": {
        "tls": true,
        "tlsCAFileAsset": "certificate.pem"
      }
    }
  }

Not sure whether I have the one I am passing is correct or not. I am just passing the variables I have from the Document DB String

Please let me know if there is anything missing.

Pls update, its urgent

I am facing similar issue, can you please share if you have found the solution?
Thanks

I’ve tried yet, but there are some information:
http://mongodb.github.io/node-mongodb-native/3.1/tutorials/connect/ssl/
You will need to add ssl=true to the connection string
You will need to add this to Meteor Settings:

"packages": {
    "mongo": {
      "options": {
        "sslValidate": true,
        "sslCA": "THE certificate.pem file content"
      }
    }
  }
1 Like

Thanks I was able to connect using the above settings and adding MONGO_URL as environment variable.

2 Likes