Atlas Triggers
AI-generated content
This document was generated by an AI assistant. Verify accuracy before relying on the details.
The producer side of every async ADB event is a MongoDB Atlas Trigger — a server-side function that watches a single collection's change stream and pushes a transformed message to AWS EventBridge (or, for two internal cases, to a Realm function). Triggers are NOT managed by the new infra/ Pulumi project — they live in the Atlas App Services app triggers-kkeqz and are deployed via realm-cli. The legacy management scripts are in adb-infrastructure/mongodb-atlas/realm-cli/triggers/.
At a glance
| Fact | Value | Source |
|---|---|---|
| Atlas project | adb-prod (65b269f45146181dace9b228) | atlas projects list |
| Cluster | adb-prod (M20, MongoDB 8.0.21, Azure FRANCE_CENTRAL) | atlas clusters describe adb-prod |
| Realm app | triggers-kkeqz, region aws-eu-west-1, deployment LOCAL | realm-cli pull |
| Trigger count | 18 (16 → AWS EventBridge, 2 → internal Realm functions) | realm-cli pull |
| AWS target | account 182790345476, region eu-west-3 | trigger event_processors.AWS_EVENTBRIDGE.config |
| Time zone in payloads | Europe/Paris | trigger project.requestContextData |
Details
Trigger inventory
Producer-side mapping (database, collection, operations watched):
| Trigger | DB | Collection | Ops | → AWS |
|---|---|---|---|---|
| accounting-entry-modified | adb-accounting | domain_object_accounting_entry | I/U/R/D | ✅ |
| accounting-event-modified | adb-accounting | accounting_event | I/U/R/D | ✅ |
| auxiliary-account-balance-updated | adb-accounting | ledger_auxiliary_account | U/R | ✅ |
| payment-modified | adb-accounting | payments | I/U/R/D | ✅ |
| contract-modified | adb-contracts | contracts | I/U/R/D | ✅ |
| direct-debits-status-processed | adb-contracts | direct_debits | U/R | ✅ |
| dunning-notice-sent | adb-contracts | dunnings | I/U | ✅ |
| file-metadata-modified | adb-files | files | I/U/R/D | ✅ |
| index-created | adb-utilities | indexes | I | ✅ |
| organization-modified | adb-persons | organization | I/U/R/D | ✅ |
| person-modified | adb-persons | persons | I/U/R/D | ✅ |
| part-modified | adb-parts | parts | I/U/R/D | ✅ |
| parts-charge-budget-modified | adb-parts | charges | I/U/R/D | ✅ |
| parts-market-performance-modified | adb-parts | market_performances | I/U/R/D | ✅ |
| ticket-event-modified | adb-tickets | events | I/U/R/D | ✅ |
| ticket-modified | adb-tickets | tickets | I/U/R/D | ✅ |
| notification-definition-modified | adb-utilities | notification_definitions | I/U/R/D | ❌ → Realm fn |
| notification-ttl-deleted | adb-utilities | notifications_ttl | D | ❌ → Realm fn |
Database naming convention
Each microservice owns its own MongoDB database, named identically: adb-<service> (e.g. adb-contracts, adb-accounting). The adb-tickets database exists and triggers fire on it even though there's no adb-tickets/ directory in the monorepo today.
How to inspect or change a trigger
See MongoDB Atlas — Realm CLI setup for the install + auth steps. Then:
realm-cli login --api-key "$MONGODB_ATLAS_PUBLIC_API_KEY" --private-api-key "$MONGODB_ATLAS_PRIVATE_API_KEY"
realm-cli pull --remote triggers-kkeqz --local /tmp/realm
ls /tmp/realm/triggers
# Each <name>.json has config.{database,collection,operation_types} + event_processors.AWS_EVENTBRIDGE.config
To deploy a change, edit the JSON in the legacy adb-infrastructure/mongodb-atlas/realm-cli/triggers/ checkout (or in your realm-cli pull working copy) and realm-cli push --remote triggers-kkeqz.
Open questions
- Why does every trigger's
projectsetevent: "CREATED"andoperationType: 1as static literals? Real values should come from the change-stream metadata. - Atlas Triggers don't appear in any IaC — they're managed by hand-edited JSON in
adb-infrastructure/. Should they move to a Pulumi MongoDB Atlas provider integration so the newinfra/is the single deploy surface? - The
notification-*triggers don't go to AWS — they call a Realm function. The function source is inrealm-pull/functions/. We don't currently document what those functions actually do.