mongodb://bard:<passwrd>@docdb-2022-06-13-02-18-07.cluster-c6wqayu9kx2t.ap-northeast-2.docdb.amazonaws.com:27017/?ssl=true&ssl_ca_certs=rds-combined-ca-bundle.pem&replicaSet=rs0&retryWrites=false
I want to link AWS DocumentDB.
I want help.
Hey @prove-ability, this error indicates that you are not passing the pem file contents into the Mongo options. You will need to have your .pem file locally and pass the contents into payload.init
under mongoOptions
. Here is an (untested) example:
const caContent = fs.readFileSync('/path/to/rds-combined-ca-bundle.pem');
payload.init({
// ..
mongoOptions: {
sslCA: caContent,
},
});
Let me know if that gets you any further.
Here are some links to SO issues that may be useful as well: link, link
The method that I told you didn't work.
So I tried to proceed after watching AWS DOCS, but this also doesn't work.
Do you have any idea?
// Initialize Payload
payload.init({
secret: process.env.PAYLOAD_SECRET,
mongoURL: process.env.MONGODB_URI,
express: app,
onInit: () => {
payload.logger.info(`Payload Admin URL: ${payload.getAdminURL()}`)
},
mongoOptions: {
tlsCAFile: `${__dirname}/rds-combined-ca-bundle.pem`
// ssl: true,
// sslValidate: false,
// sslCA: `${__dirname}/rds-combined-ca-bundle.pem`
}
})
hello @prove-ability
Besides the SSL-issue, do you think DocumentDB's MongoDB API compatibility sufficient for PayloadCMS purposes?
@x31b — yes, you should be able to 100% use DocumentDB!
Awesome. Thanks @jmikrut
@prove-ability Have you gotten the DocumentDB to work?