Skip to content

Documentation · Infrastructure runs

Notifications for infrastructure runs

Push run state transitions to a webhook, Slack or Google Cloud Pub/Sub, using the Terraform Cloud notifications API.

A workspace can push run state transitions to your own systems. This is the Terraform Cloud notifications API, so you configure it with the documented endpoints or with the tfe provider's notification_configuration resource.

There is no screen for this in the dashboard yet; it is configured over the API. CI job notifications are separate and are configured in the dashboard, under Settings — see notifications.

destination-typewhat it does
genericHTTP POST of the run payload to a URL you choose
slacka Slack message
gcppubsuba message on a Google Cloud Pub/Sub topic

email and microsoft-teams are not supported. HCP Terraform has both; if you rely on them today, a generic webhook into whatever already receives your alerts is the usual replacement.

Follow the create-a-notification-configuration endpoint. The request and response shapes are the documented ones.

Set destination-type to gcppubsub and url to:

gcppubsub://<project-id>/<topic>

where <project-id> is the Google Cloud project and <topic> is the Pub/Sub topic id. Grant our publisher identity permission to publish to that topic.

The message body is the same JSON payload documented for the generic destination. Each message additionally carries attributes, which is what makes a subscription filter possible:

attributevalue
otf.ninja/v1/workspace.namethe workspace name
otf.ninja/v1/workspace.idthe workspace id
otf.ninja/v1/tags/<tag>true, once per tag on the workspace

Those attribute keys are on the wire and cannot change without breaking every subscription filter already written against them, which is why they still carry the upstream project's namespace. Match on them exactly as written.