Skip to main content

Connect MongoDB

This page describes how to connect and manage your MongoDB account from the DoiT console. Once connected, you can use your MongoDB usage and cost data within the DoiT console. See Working with MongoDB data.

Required permissions

To integrate MongoDB with DoiT, your MongoDB account must have the Organization Owner permission.

To connect your MongoDB account with DoiT, your DoiT account must have the Billing Profiles Admin permission.

Connect your MongoDB organization

You can connect one or more MongoDB accounts. To do this, repeat the connection steps for each account you want to connect.

To help you connect your MongoDB accounts, the DoiT console provides a step-by-step wizard, which you can launch in multiple ways:

  • Navigate to the Home page, scroll down to the Connect your cloud section, and then choose Connect your MongoDB account.

  • Navigate to the Assets page. Choose MongoDB in the left-hand menu and then select Connect new account.

  • Navigate to the MongoDB Lens dashboard and then select Connect your MongoDB.

The wizard contains two steps:

MongoDB onboarding wizard

Configure your service account

To enable DoiT to programmatically access MongoDB, you must create one MongoDB service account per MongoDB organization and generate a secret.

  1. Sign in to the MongoDB console.

  2. Select your organization name.

  3. In Organization, select Access Manager.

  4. Select Add new, and then select Service Account.

  5. In Name, enter a name that fits the usage, for example, DoiT.

  6. In Description, enter a description for the service account.

  7. In Client Secret Expiration drop-down list, select 365 days.

    Note

    We recommend setting the service account's secret lifetime to 365 days to ensure the longest possible continuous connection between DoiT and MongoDB. However, you can set this duration to align with your organization's security policies. Once your MongoDB service account is connected, you can refresh your MongoDB service account secret using the DoiT wizard.

  8. From the Organization Permissions drop-down list, select the following permissions:

    • Organization Billing Viewer

    • Organization Read Only

    • Organization Member

  9. Select Create.

  10. Copy both the Client ID and Secret.

    Caution

    The secret is only visible once. Please ensure you copy the secret before closing the browser window.

    MongoDB onboard service account

  11. Go to the DoiT console and select Next.

Configure your service account credentials

Once you have created your MongoDB service account, you must add the Client ID and secret to the DoiT wizard. Furthermore, we use Google Cloud VPC and CloudNat to ensure that all outgoing requests are routed through specific IP addresses. You must add these IP addresses to the API Access List for your MongoDB service account.

  1. In Credentials, paste the MongoDB client ID that you created above in Client ID.

  2. In Secret, paste your MongoDB secret.

  3. Copy the following IP Addresses:

    34.121.183.173
    34.134.157.59
    34.134.111.192
    34.69.217.183
    35.192.89.77
  4. Go back to the MongoDB console.

  5. Select your organization name.

  6. In Organization, select Access Manager.

  7. Select the Applications tab, and then select Service Accounts.

  8. Select the service account you created above.

  9. Select Add Access List Entry.

  10. In Add Access List Entry, paste one of the IP addresses you copied above.

  11. Select Save.

  12. Repeat steps 10-11 until you have added all the IP addresses.

    MongoDB onboard credentials

  13. Go back to the DoiT console.

  14. Select Test connection.

  15. Once the test is successful, select Finish. After you successfully connected your MongoDB accounts, we start importing your MongoDB billing and usage data. The process can take a few hours. You'll receive an email when the data is available for Cloud Analytics and other DoiT features.

Delete your MongoDB organization

You can delete your MongoDB cost and usage data from the DoiT console by deleting your MongoDB organization.

  1. Sign in to the DoiT console, select Integrate from the top navigation bar, and then select Assets.

  2. Select MongoDB from the left-hand menu.

  3. Select the three dots menu () at the rightmost end of the MongoDB organization that you want to delete and select Delete organization.

    Delete your MongoDB organization

  4. Select Delete to delete the MongoDB organization from DoiT.