🏗️🚧 The TofuTF docs are under construction.

Topics
Notifications

Notifications

tofutf can send notifications for run state transitions. tofutf implements the TFC notifications API (opens in a new tab), which means you can use the same documented API endpoints to configure notifications. Alternatively you can use the tfe terraform provider (opens in a new tab).

!!! note Currently you cannot configure notifications via the UI.

Support exists for the following destination types:

  • generic: Generic HTTP POST notifications
  • slack: Slack messages
  • gcppubsub: GCP Pub/Sub topic messages (*tofutf specific)

!!! note Currently there is no support for the email or microsoft-teams destination types (which TFC does support).

GCP Pub Sub

tofutf can send notifications to a GCP Pub/Sub topic (opens in a new tab). To configure these notifications see the TFC notifications API documentation (opens in a new tab), in particular the endpoint for creating a notification configuration.

For the destination-type field, use gcppubsub.

For the url field, enter gcppubsub://<project-id>/<topic>, where <project_id> is the GCP project ID and <topic> is the Pub/Sub topic ID.

Ensure tofutfd has access to default credentials for a service account which has necessary permissions to publish messages to the configured topic.

The payload of the messages is the same as that documented for the generic destination type (opens in a new tab) (using the JSON format).

Additionally, attributes are added to each message:

keyvalue
tofutf.ninja/v1/workspace.name<workspace_name>
tofutf.ninja/v1/workspace.id<workspace_id>
tofutf.ninja/v1/tags/<tag_name>true

Attributes permit you to filter messages from a subscription (opens in a new tab) in GCP.