Instantly triage failed Terraform runs in Slack and Jira

By General Input

When an HCP Terraform run fails, we instantly explain what broke in your infrastructure Slack channel and open a Jira bug for the platform team to fix.

Integrations

  • HCP Terraform (Terraform Cloud)
  • Slack Bot
  • Jira

Type

Agentic Task

Categories

  • Engineering

Trigger this workflow from an HCP Terraform run notification webhook. In HCP Terraform, open each workspace you want to monitor, go to Settings then Notifications, add a notification configuration of type Webhook that points at this workflow's webhook URL, and scope it to the run errored / failed events. Terraform will then POST to this workflow whenever a run in that workspace errors.

When a webhook arrives, read the run ID and the run status from the notification payload. Only continue for genuine plan or apply failures (an errored run). If the run was user-canceled, force-canceled, or discarded, stop without posting to Slack or opening a Jira ticket, so we do not create noise for runs that never really failed.

Call Show Run on the run to confirm its status and collect the links to its plan and apply. Then call Get Plan JSON Output to read what the plan attempted to change.

Using the run status and the plan, diagnose the most likely cause of the failure and describe it in plain language a teammate can act on, for example a provider authentication error, a missing or invalid variable, a resource that already exists, or a dependency or timeout during apply. Keep it to a short, specific summary rather than a raw log dump.

Post an alert to our infrastructure Slack channel using the Slack Bot Send a Message action. Include the workspace name, the run status, your plain-language diagnosis of the most likely cause, and the links to the run's plan and apply so the team can jump straight to the details.

Open a Jira issue with Create Issue that captures the workspace, a concise summary of the error, and links back to the run. Set the issue type to Bug and assign it to the platform team so the failure is owned and tracked to resolution.

Related prompts

Explore more prompts
A brand asset library your marketing team actually searchesTurn Mailjet email clicks into ranked HubSpot follow-upsClean out the Looker dashboards and Looks nobody opensLiveKit live operations console for room moderationWake up dormant Keap leads with a researched reasonLiveChat coverage board for planning next week's shiftsPhone routing control panel for LiveKit voice agentsLinkedIn Ads budget pacing dashboard for every client accountGive your team Looker numbers without buying more seatsPause marketing emails to escalated customers, then restore them