MongoDB
Connect to MongoDB databases from Airplane runbooks.
The MongoDB resource allows tasks and runbooks to connect to a MongoDB database. For a high-level
introduction to resources, see the resources page.
Creating a MongoDB resource
To create a new MongoDB resource, visit resources
for your team, click the "New" button, and select the MongoDB resource type. Enter your connection
details in the form:

Name should be a human-readable name for your resource. You'll use this name to later reference
this resource in tasks.
Connection string should be the full connection string for your MongoDB database. This
typically looks something like:
Copied1mongodb+srv://username@password:yourhost/yourDatabase
Be sure to include your username and password. The connection string is stored encrypted at rest and
won't be displayed back to users.
IP whitelisting
If your database has restrictions on incoming network connections, you'll need to ensure the
Airplane IP addresses are whitelisted:
- 34.121.89.145
- 34.68.100.27
- 34.72.182.225
Working with MongoDB resources
You can use MongoDB resources with runbooks by adding a
MongoDB block. You can run commands like
find
and
insertMany
directly from the runbook. See
Integration blocks for details.MongoDB resources can't currently be used inside tasks. Instead, we recommend building a runbook
with a MongoDB block.
Private networking
To connect to a database inside a private VPC, you can self-host the agent and
run the agent within your own VPC. Since tasks and MongoDB commands run on agents, these tasks will
run from within your network and be able to connect.