Skip to content
Docs

How to rotate the secrets of your MongoDB Atlas integration

This will guide you how to update the password for a MongoDB Atlas databse.

When you change the MongoDB password, the current one will immediately stop working. All projects that rely on the password will be unable to connect to the database until they are re-deployed.

Secret rotation is a security best practice that limits the exposure window if a credential is compromised. You might rotate secrets when:

  • A team member with access to credentials leaves
  • You suspect a credential has been exposed
  • Your security policy requires periodic rotation

These steps will guide you on updating the password for your MongoDB database.

Copy link to headingPrerequisites

  • You have a MongoDB Atlas database through a Native integration from Vercel Marketplace.
  • You have access to manage your account's resources, including your MongoDB Atlas integration.

Copy link to headingSteps

Copy link to headingStep 1: Go to MongoDB Atlas from your integration

  1. From your Vercel dashboard, go to the Integrations tab.
  2. Next to the integration, select the Manage button. Native integrations appear with a billable badge.
  3. On the Integrations page, select the Open in MongoDB Atlas button.

Copy link to headingStep 2: Under “Security” in the left navigation click “Database & Network”.

The MongoDB Atlas main dashboard. The left navigation is open and "Database & Network" under the Security section is highlighted.
MongoDB Atlas dashboard

Copy link to headingStep 3: Select Edit on the user in the list. A modal will open.

The page showing the MongoDB database users, with edit button. There is a single user in the list.
MongoDB database users list

Copy link to headingStep 3: Select Edit Password and then Autogenerate Secure Password

The top portion of the edit form for a MongoDB database user, including the Edit Password button.
MongoDB database user edit form
A section of the MongoDB database user edit form. "Edit Password" has been clicked, so a button is visible to autogenerate a secure password.
Autogenerate the MongoDB database password

Copy link to headingStep 4: Scroll to the bottom of the modal and click Update User to save your changes.

Copy link to headingStep 5: Deploy your projects on Vercel

  • Go back to your MongoDB Atlas integration on Vercel and confirm the new environment variables are available
  • Deploy any connected projects in Vercel