Track every Terraform run in Slack and a spreadsheet
Automatically announce every new Terraform run in your deploys channel and log it to a spreadsheet, so anyone can see what changed and when.
Whenever a new run is queued on one of my HCP Terraform (Terraform Cloud) workspaces, keep a running audit trail of the infrastructure change. Use the poll trigger for a new run on a workspace so this workflow fires each time a run is queued.
For each new run, read the run with the HCP Terraform Show Run action to pull the details I care about: the workspace name, the run id, what kicked off the run (the trigger source or who created it), the run message, the timestamp it was created, and a link to the run in HCP Terraform.
Then do two deterministic things. First, post a short announcement to our deploys channel using the Slack Bot Send a Message action. Keep it brief and fixed: the workspace name, the run message, what triggered it, and the link to the run.
Second, append one row to a Google Sheet using the Append Values action. Log the workspace name, run id, trigger source, run message, and a link to the run, one field per column, in the same order every time.
Keep the format fixed at exactly one row per run with no interpretation or summarization. The goal is a clean, searchable change history that non-engineers can read, not a summary.
Additional information
What does this prompt do?
- Watches your HCP Terraform workspaces and reacts the moment a new run is queued
- Posts a short announcement to your deploys channel in Slack with the key details and a link to the run
- Appends one row per run to a Google Sheet, building a searchable history of infrastructure changes
- Keeps the format fixed and consistent so non-engineers can read the change log at a glance
What do I need to use this?
- An HCP Terraform (Terraform Cloud) account with the workspaces you want to watch
- A Slack workspace and a channel for deploy announcements
- A Google account with a spreadsheet to store the change history
How can I customize it?
- Choose which Slack channel receives the announcements
- Point it at the exact Google Sheet and tab where the log should live
- Adjust which details appear in the announcement and the logged row, such as workspace, run message, who triggered it, and the link
Frequently asked questions
What counts as a Terraform run?
Will non-engineers be able to understand the log?
Does it change or summarize the information?
Can I send announcements to a specific channel?
How quickly does it react to a new run?
Related templates
Keep a change log of every infrastructure change.
Set up automatic Terraform run tracking in Slack and Google Sheets in minutes.