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.
-
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.
-
Make note of both the public and private keys for use creating a MongoDB Connection below.
-
Find and make note of your MongoDB Organization ID for later. This is typically found in the Organization Settings of your MongoDB admin console.
Create a MongoDB Connection
- In CloudZero, navigate to Settings by selecting the gear icon in the top navigation bar.
- Select the Add Connection button.
- Select the MongoDB tile.
- 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.
- 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:
- Enable Use Fixed IP Address for the CloudZero Managed MongoDB Connection.
- In your MongoDB account, navigate to Access Manager > Organization Access > API Keys.
- Edit the API key used for the CloudZero connection.
- Click Next.
- Select Add Access List Entry and enter
52.0.118.180
. Click Save. - Select Add Access List Entry again and enter
52.0.33.111
. Click Save.
The API Access List should match the following:
Updated about 1 month ago