Connecting to MongoDB

Connections are how CloudZero manages the various Cost Sources that bring Billing, Resource, and other types of data into the platform.

How the MongoDB Connection Works

The CloudZero MongoDB connection utilizes API access to MongoDB Atlas to gather billing data for your organization.

Connection Prerequisites

Obtain a MongoDB API Key

In order for the adaptor to be able to access the data it needs from your MongoDB organization, you will need an API key.

  1. Set up an API key for your MongoDB organization according to the MongoDB Create an API Key documentation. The API Key will require "Organization Billing Viewer" permissions.

  2. Make note of both the public and private keys for use creating a MongoDB Connection below.

  3. Find and make note of your MongoDB Organization ID for later. This is typically found in the Organization Settings of your MongoDB admin console.

    Organization ID Location

Create a MongoDB Connection

  1. In CloudZero, navigate to Settings by selecting the gear icon in the top navigation bar.

Navigation Bar - Setting gear

  1. Select the Add Connection button.
  2. Select the MongoDB tile.

MongoDB Connection Tile

  1. Enter the connection metadata:
  • Public Key: This is the public MongoDB API key you created above.
  • Private Key: This is the private MongoDB API key you created above.
  • Organization ID: This is your MongoDB Organization ID you located above.
  • Use Fixed IP Egress: Enable this if you would like to use MongoDB's fixed IP egress functionality. See below.
  1. Select the Save button.
    You will be redirected to the Connection Details page, where you should see your newly created connection.

MongoDB Connection Notes

Billing Period Ingest Windows

  • Newly Created Connection: CloudZero will ingest the most recent 24 months of billing periods, if available.
  • Re-enabled Connection: CloudZero will ingest up to 24 months of billing periods starting from the current billing period and going back to the most recent billing period ingested.
  • Steady State: CloudZero will ingest the current and previous billing period and the previous billing period.

MongoDB Fixed IP Egress

To establish a MongoDB connection, you must provide an API key. MongoDB allows restricting API key usage to specific IP addresses, which can be configured as follows:

  1. Enable Use Fixed IP Address for the CloudZero Managed MongoDB Connection.
  2. In your MongoDB account, navigate to Access Manager > Organization Access > API Keys.
  3. Edit the API key used for the CloudZero connection.
  4. Click Next.
  5. Select Add Access List Entry and enter 52.0.118.180. Click Save.
  6. Select Add Access List Entry again and enter 52.0.33.111. Click Save.

The API Access List should match the following:

MongoDB API Access List