Like what we’re doing? Star us on GitHub!

Can I use AWS DocumentDB instead of MongoDB?

9 months ago
2 2


I want to link AWS DocumentDB.
I want help.

스크린샷 2022-06-13 오전 11 29 52

  • denolfe
    Payload Team
    9 months ago

    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');
      // ..
      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

    4 replies
  • prove-ability
    9 months ago

    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
      secret: process.env.PAYLOAD_SECRET,
      mongoURL: process.env.MONGODB_URI,
      express: app,
      onInit: () => {`Payload Admin URL: ${payload.getAdminURL()}`)
      mongoOptions: {
        tlsCAFile: `${__dirname}/rds-combined-ca-bundle.pem`
        // ssl: true,
        // sslValidate: false,
        // sslCA: `${__dirname}/rds-combined-ca-bundle.pem`
  • x31b
    8 months ago

    hello @prove-ability

    Besides the SSL-issue, do you think DocumentDB's MongoDB API compatibility sufficient for PayloadCMS purposes?

  • jmikrut
    Payload Team
    8 months ago

    @x31b — yes, you should be able to 100% use DocumentDB!

  • x31b
    8 months ago

    Awesome. Thanks @jmikrut

  • moltar
    3 months ago

    @prove-ability Have you gotten the DocumentDB to work?

Open the post
Continue the discussion in GitHub
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More