Skip to main content

Data & Event Flow

Data enters Massdriver through the UI, the mass CLI, the GraphQL API, the Terraform provider, cloud alarm webhooks, and running deployments. Massdriver records each change as one event in your organization's audit log. Data leaves through event destinations, GraphQL subscriptions, API and CLI reads, resource exports, and the dependencies of later deployments.

INMASSDRIVEROUTSTASHmass alpha stash setAPI, Terraform providerIMPORTED RESOURCESmass resource createUI, API, TerraformCONFIG & DEPLOYMENTSmass instance deployUI, API, CI pipelinesALARM STATESalarm webhook URLCloudWatch, Alertmanagerrecordsevery change as one eventin the audit log resolvesdependencies from links,defaults, remote refs queuesone running deploymentper instanceEVENT DESTINATIONSHTTP SlackServiceNow PagerDutySUBSCRIPTIONSGraphQL over WebSocketthe UI updates liveAPI & CLI READSqueries, mass get/listauditLogsRESOURCE EXPORTSmass resource downloadexportResourceparams, dependencies,secrets, tokenresources, stash,status, logsDEPLOYMENTyour bundle's IaCin the provisioner

In​

InputInterfacesEvents
Instance configuration and deploymentsUI, mass instance deploy, mass environment deploy, createDeployment, proposeDeployment, GitHub Actiondeployment.*, instance.updated
Imported resourcesUI Import Resource, mass resource create, createResource, massdriver_imported_resourceresource.imported, resource.updated, resource.deleted
Provisioned resourcesA deployment: jq resource templates or massdriver_resourceresource.provisioned, resource.deleted
Stash entriesmass alpha stash set, alphaSetStashEntry, massdriver_stash_entry, a deploymentstash_entry.set, stash_entry.deleted
Instance secretssetInstanceSecret, removeInstanceSecretsecret.set, secret.unset
Alarms and alarm statesmassdriver_instance_alarm, createInstanceAlarm, the environment's alarm webhook URLalarm.*, alarm_state.created
Dependency wiringmass component link, mass environment default, mass instance remote-reference set, mass resource grant create, the APIlink.*, connection.*, environment_default.*, remote_reference.*
Bundles and resource typesmass bundle publish, mass resource-type publishrepo.published, resource_type.published

Deployments​

A person, CI job, or service account creates a deployment of an instance: a direct deployment, a proposal, a plan, or a rollback. The deployment snapshots the instance's params, the resources that fill its dependencies, and the bundle version. Refer to Deployments.

After a deployment is created, Massdriver and the provisioner set its status. Each change of status records an event:

EventWhen
deployment.createdAny deployment is created, including a proposal and a rollback.
deployment.proposedA deployment is proposed for approval. A rollback is always proposed.
deployment.approved, deployment.rejectedA reviewer decides on a proposal.
deployment.enqueuedThe deployment reaches the front of its instance's queue and goes to a runner.
deployment.startedThe provisioner reports RUNNING.
deployment.completed, deployment.failedThe provisioner reports the result.
deployment.abortedA person or service account aborts the deployment.

The provisioner also streams the deployment's logs, which mass deployment logs and the deploymentLogs subscription read.

Imported resources​

An imported resource records infrastructure that Massdriver did not provision, such as an existing VPC or a cloud credential. Its payload must match the schema of its resource type. Create one in the UI, with mass resource create, with createResource, or with the Terraform provider's massdriver_imported_resource. Refer to Import a Resource.

An imported resource has a UUID and no instance. You can change it with mass resource update or updateResource, which records resource.updated. You cannot delete it while a connection uses it.

Provisioned resources​

After a provision step, the provisioner renders each resource that the bundle declares under resources and sends it to Massdriver with the deployment's token. OpenTofu and Terraform steps can also send resources with the provider's massdriver_resource. Massdriver validates each resource against its resource type and records resource.provisioned. A later deployment that sends the same resource replaces it and records resource.provisioned again. Refer to Provisioners: Resources.

A provisioned resource belongs to its instance. Its ID is <instance ID>.<field>, such as ecomm-prod-db.authentication. Only a deployment of that instance can change it. A decommission deletes it.

Stash​

The stash holds key and value entries on a project, environment, component, instance, or deployment. People, CI jobs, automations, and deployment steps write to it with mass alpha stash set, the GraphQL API, or the Terraform provider's massdriver_stash_entry. Massdriver stores each value as written and does not act on it.

Each set and delete records stash_entry.set or stash_entry.deleted. A sensitive value is never in an event. An entry that expires records no event.

Alarms​

A bundle registers an instance alarm with massdriver_instance_alarm. The cloud's monitoring service sends state changes to the environment's alarm webhook URL, and each change records alarm_state.created. Refer to Monitoring & Alarms.

Dependency wiring​

These inputs decide which resource fills a dependency of an instance:

InputInterfacesEvents
A link on the project blueprintUI, mass component linklink.created and link.deleted, then connection.created and connection.deleted for each instance that the link fills
An environment defaultUI, mass environment default, setEnvironmentDefaultenvironment_default.created, environment_default.deleted
A remote reference on an instanceUI, mass instance remote-reference set, setRemoteReferenceremote_reference.assigned, remote_reference.unset
A grant of a resource to other environmentsmass resource grant create, createResourceGrantNone

The order in which they fill a slot is in What fills a slot. Grants are in Share Resources.

Out​

OutputInterfacesDelivery
Event destinationsHTTP, Slack, ServiceNow, PagerDutyPushed. Retried, at least once, kept for redelivery.
GraphQL subscriptionsWebSocketPushed while connected.
API and CLI readsGraphQL queries, mass ... get and listPulled.
Resource exportsmass resource download, mass instance export, exportResourcePulled. Records resource.exported.
Dependencies of a deploymentThe provisionerSnapshotted when the deployment is created.

Event destinations​

An event destination receives the audit log events that you select. Create one in the UI, with mass event destination create, with createEventDestination, or with the Terraform provider's massdriver_event_destination.

BehaviorSummary
SelectionEvent types (deployment.failed, deployment.*, or all), then exact-match Attributes such as md-environment, then an optional jq Condition.
Previewmass event destination preview and previewEventDestination show the recent events that a selection matches, before you create the destination.
TestSend test event or testEventDestination sends one event_destination.tested event and shows the result.
PayloadOne CloudEvent per event. The HTTP adapter signs it with Standard Webhooks.
Order and duplicatesAny order. At least once. Drop duplicates by the event id.
RetriesExponential backoff from 30 seconds to 1 hour, 10 attempts. Then the delivery is FAILED.
DeliveriesPENDING, DELIVERED, SKIPPED, or FAILED. mass event destination deliveries lists them.
Redeliverymass event destination redeliver and redeliverEvents send failed events again with all their attempts.
Pause and resumeA paused destination keeps its deliveries and sends them on resume. Massdriver pauses a destination after 24 hours of failed sends.

A new destination gets events that occur after you create it. To act on events, run an automation behind an HTTP destination.

Event types​

A destination selects from these event types. mass event type list, the eventTypes query, and the Terraform provider's massdriver_event_types data source list them with their descriptions and metadata fields. Event Reference lists the fields of each entity.

EntityActions
deploymentcreated, proposed, approved, rejected, enqueued, started, completed, failed, aborted
instancecreated, updated, deleted, orphaned, moved
connectioncreated, deleted
remote_referenceassigned, unset
resourceimported, updated, deleted, provisioned, exported
resource_typepublished, deleted
repopublished, created, updated, deleted
projectcreated, updated, deleted, cloned
environmentcreated, updated, deleted, forked
environment_defaultcreated, deleted
componentcreated, updated, deleted
linkcreated, deleted
secretset, unset
stash_entryset, deleted
alarmcreated, updated, deleted
alarm_statecreated
organizationcreated, updated
accountregistered
access_tokencreated, revoked
service_accountcreated, updated, deleted
groupcreated, updated, deleted
group_invitationaccepted, revoked
group_membershipadded, removed
custom_attributecreated, updated, deleted
event_destinationcreated, updated, paused, resumed, redelivered, lagging, caught_up, deleted

The event type is <entity>.<action>, such as resource.provisioned.

GraphQL subscriptions​

The GraphQL API pushes changes over a WebSocket. The Massdriver UI uses the same subscriptions. A subscription sends only the events that occur while it is connected. An event about an entity that you cannot view arrives as null.

SubscriptionSends
organizationEventsNew projects, new repositories, and published bundle versions
projectEventsThe project, its environments, components, and links
environmentEventsThe environment, its defaults, instances, connections, and alarms
instanceEventsThe instance's configuration, deployments, incoming connections, and alarms
deploymentEventsStatus changes of one deployment
deploymentLogsLog batches of one deployment
alphaStashEventsStash sets and deletes in a project, and in one environment

The project, environment, instance, and deployment subscriptions also send stash changes. Refer to Stash: Events.

API and CLI reads​

The GraphQL API and mass read back the inputs above, with commands such as mass deployment get, mass resource list, mass alpha stash get, and mass event destination deliveries. The auditLogs query returns the audit log, filtered by time, event type, and actor. It holds the same events that destinations receive, including events that occurred before a destination existed.

Resource exports​

mass resource download, mass instance export, and exportResource return a resource's payload with its sensitive fields unmasked, in JSON or in a format that its resource type defines, such as a kubeconfig. Each export records resource.exported. To find exports that revealed a secret, select resource.exported with the condition .data.metadata.contains_secrets == true.

Into a deployment​

A resource leaves Massdriver as the value of a dependency of another instance. The resource reaches that instance through a link, an environment default, or a remote reference. An environment default or a remote reference needs a grant of the resource to the instance's environment.

When a deployment is created, Massdriver snapshots the current payload of each resource that fills a dependency. The provisioner receives the snapshot with the params, the instance's secrets, the deployment's token as MASSDRIVER_TOKEN, and, when enabled, deployment identity tokens. A changed resource does not redeploy its dependents. They get the new payload on their next deployment. To deploy them when an instance finishes, run autodeploy-downstream.

A deployment can also read the stash of its instance, environment, component, and project, and the stash of each instance whose resources fill its dependencies. Refer to Stash for Provisioners.