Connecting to MongoDB

Connect your MongoDB Atlas account to CloudZero to bring your MongoDB cost and usage data into a unified view of all your cloud and SaaS spend. CloudZero organizes your MongoDB costs, along with your other costs, into categories (called Dimensions) that matter most to your business. For example: business unit, team, product, feature, environment, customer, or virtually anything else. Once connected and organized, you can quickly answer questions about your spend that matter to your stakeholders.

This guide covers creating a MongoDB API key and configuring the connection in CloudZero. All access is read-only.

ℹ️

CloudZero supports MongoDB Atlas only. For self-hosted MongoDB deployments, billing data is included in your cloud provider's billing connection.

What you need

  • CloudZero user with data configuration permissions
  • MongoDB Atlas account with permissions to create organization-level API keys
ℹ️

A MongoDB API key grants access only to the organization where it was created. To connect linked organizations, create a separate API key and CloudZero connection for each.

Step 1: Create a MongoDB API key and locate your Organization ID

For full details, see MongoDB's API access documentation.

  1. In MongoDB Atlas, create an organization-level API key with Organization Billing Viewer permissions.
  2. Copy the public key and private key. You need these in Step 2.
  3. Navigate to Organization Settings and copy your Organization ID.

Step 2: Configure the connection in CloudZero

  1. In CloudZero, go to Settings > Cloud Connections.

  2. Select Create Connection + and select the MongoDB tile.

  3. Enter the connection details:

    FieldValue
    Connection NameA name for this connection. Appears throughout CloudZero.
    Public KeyThe public key from Step 1
    Private KeyThe private key from Step 1
    Organization IDThe Organization ID from Step 1
    Use Fixed IP EgressEnable if your account restricts API access by IP. See Fixed IP egress.
  4. Select Save.

What to expect

After you save the connection, CloudZero begins pulling your MongoDB billing data:

  • New connection: CloudZero pulls up to 24 months of historical billing data if available.
  • Re-enabled connection: CloudZero pulls up to 24 months of billing data, starting from the current period back to the last previously ingested period.
  • Steady state: CloudZero pulls the current and previous billing periods.

Cost data appears in the Explorer within 24 hours.

Maintenance and configuration

Fixed IP egress

If your MongoDB account restricts API access by IP address:

  1. Enable Use Fixed IP Egress in the CloudZero connection settings.
  2. In MongoDB Atlas, navigate to Access Manager > Organization Access > API Keys.
  3. Edit the API key used for the CloudZero connection and select Next.
  4. Select Add Access List Entry and add 52.0.118.180.
  5. Select Add Access List Entry again and add 52.0.33.111.
ℹ️

Have questions or feedback? Reach out to your account manager.