See and fix Terraform variable drift across every workspace

One matrix that shows every workspace variable side by side, flags what is missing or mismatched, and fixes it only after you approve each change.

App
HCP Terraform (Terraform Cloud)GitHubEngineeringOperationsData SyncResearch & Monitoring
PromptCreate

Build me a variable hygiene console for HCP Terraform. Config differences between environments are what break our applies, and nobody can see them in one place today because HCP Terraform only lets you edit variables one workspace at a time. This is an internal app my platform team opens to compare variables across workspaces and carefully close the gaps.

The main view is a parity matrix. Use List Workspaces for my organization to get the rows and List Workspace Variables for each workspace to fill the cells. The columns are the union of variable keys across the selected workspaces, grouped by category so Terraform variables and environment variables are visually separate. Each cell shows one of: value agrees with the rest of the row group, value disagrees, key missing on this workspace, or key set but sensitive. Highlight whole columns where a key exists in some workspaces and is missing in others, and highlight individual cells where non-sensitive values disagree. Badge every entry that is marked sensitive and every entry marked HCL, and treat a key that is HCL in one workspace but plain in another as a difference worth flagging. Let me filter rows by workspace name or tag and search columns by key so the grid stays usable with dozens of workspaces. Use Show Workspace to enrich each row header with the workspace's tags, Terraform version, and current run state.

Sensitive values are never displayed anywhere in this app, and never written into any output. HCP Terraform does not return them and the app must not try to infer or reconstruct them. For a sensitive key, show only whether it is set on that workspace, so the comparison is presence only. Put a short line in the legend that says plainly that secret values are never shown.

The second tab is variable sets. Use List Variable Sets for the organization, List Variables in Variable Set for each set's contents, and Show Variable Set for its scope and attached workspaces. Render each set with its variables, following the same sensitive rule, alongside the workspaces it is applied to and whether it is global. Flag workspaces that look like they should be inheriting a set but are not, for example a workspace whose peers in the same environment group all have that set attached. From this tab I can attach a set to selected workspaces with Apply Variable Set to Workspaces, or detach it with Remove Variable Set from Workspaces, each behind a confirmation dialog that names exactly which workspaces will be affected.

Let me pick one workspace as the reference, meaning the environment I treat as the source of truth, then pick any other workspace as the target and see the two side by side. The diff groups keys into: only in the reference, only in the target, in both but with different values, in both with differing sensitive or HCL flags, and in agreement. Remember my reference workspace choice per user so the console reopens where I left it.

On the diff view there is a Reconcile button that starts a background agent for that reference and target pair. The agent re-reads both workspaces with List Workspace Variables and Show Workspace, checks the relevant variable sets, and produces a proposed plan: a list of discrete changes where each one is a single add, update, or delete, with the key, its category, the current state on the target, the proposed state, and a one line rationale. Where the right fix is inheriting a shared variable set rather than copying values workspace by workspace, the agent should propose attaching that set instead. The agent writes the plan back into the app so the diff view renders it as a review queue, and it never applies anything itself.

Approval is per change. Each proposed line has its own Approve and Skip, there is no approve all, and nothing happens in bulk. When I approve one line the app performs exactly that change with Create Workspace Variable, Update Workspace Variable, or Delete Workspace Variable, or Apply Variable Set to Workspaces for an inheritance fix, then shows the result inline as applied or failed with the error and refreshes the affected row in the matrix. For any change touching a sensitive variable the agent may only propose an add or a delete, and for an add I have to type the value into the approval dialog myself, because the platform never returns the existing one.

Persist the reconcile plans, every approve or skip decision, who made it, when, and the outcome, so the console keeps a running audit trail per workspace pair. Show recent activity on the diff view and a small last reconciled indicator on each workspace row in the matrix.

Anywhere a difference appears, whether a matrix cell, a diff row, or a proposed change, give me a Raise a ticket button that files a GitHub issue with Create an Issue in a repository I configure in settings. Prefill the title with the variable key and the two workspace names, and the body with the category, the nature of the difference, and a pointer back to this view. Never put a sensitive value in the issue body. This is the escalation path for differences that need a change in our Terraform code rather than a console edit, and the resulting issue link should be stored next to that difference so the app shows a ticket already exists.

The people using this are platform engineers making careful edits to production configuration, so bias everything toward safety: read only until I explicitly act, one change at a time, always name the workspace being modified, and make write actions visually distinct from browsing.

What does this prompt do?

  • Puts your workspaces down the side and every variable key across the top in one grid, so keys that exist in one environment but not another, and values that quietly disagree, jump out instead of hiding behind one settings page per workspace. Anything marked sensitive shows only as set or not set, never the value.
  • Lists your variable sets, what is inside each one, and which workspaces it is attached to, so you can spot a workspace that should be inheriting a shared set and is not.
  • Lets you pick a reference workspace, diff any other workspace against it, and hand the gap to a background helper that proposes the exact adds, updates, and deletes needed. Every change is approved or skipped on its own, and nothing is written until you say yes to that specific line.
  • Gives you a Raise a ticket button that files a GitHub issue when a difference needs a change in your Terraform code rather than a quick fix in the console.

What do I need to use this?

  • An HCP Terraform (formerly Terraform Cloud) account connected, with permission to view variables in the workspaces you want to compare
  • Edit permission on any workspace you want to bring in line, since reconciling writes variables back
  • The name of the HCP Terraform organization whose workspaces should appear in the grid
  • A GitHub account connected and the repository where infrastructure tickets belong, if you want the Raise a ticket button

How can I customize it?

  • Choose which workspaces appear in the grid, for example only production and staging, or everything tagged for one product team
  • Set a default reference workspace so the console always opens with the environment you treat as the source of truth
  • Point the ticket button at a different repository, or add labels so infrastructure issues land in the right queue

FAQs

Can this see my secret values?
No. HCP Terraform never hands out the value of a variable marked sensitive, and this console does not try to work around that. Sensitive keys show only as set or not set, so a comparison tells you whether both workspaces have the key, never what is inside it.
Will it change anything without asking me first?
No. Every add, update, and delete is proposed as a separate line you approve or skip. There is no approve all button, nothing applies in bulk, and nothing runs on a schedule. The console only writes when you approve that one specific change.
Does it cover variable sets as well as per-workspace variables?
Yes. A second tab lists your variable sets, the variables inside them, and the workspaces each one is attached to. From there you can attach a shared set to a workspace that is missing it, or detach one, with a confirmation that names exactly which workspaces are affected.
What about differences that should be fixed in code, not in the console?
Use the Raise a ticket button next to the difference. It files a GitHub issue describing which workspaces disagree and on which key, so the fix happens in your Terraform code. The issue link is kept next to that difference in the console.
Does it work with HCP Terraform, or only Terraform Enterprise?
It works with HCP Terraform, formerly known as Terraform Cloud. You connect your account, and you need enough permission to read variables in the workspaces you compare plus edit rights on any workspace you want to reconcile.

Related templates

Open a Heroku release war room the moment production looks wrong

See every recent deploy across all your Heroku apps in one timeline, then roll back, restart, or file an incident without leaving the screen.

Heroku
GitHub
Linear
App
Work your whole Terraform approval queue from one board

Every Terraform run that needs a human, across every workspace, on one board with approve, discard, and plain English plan summaries.

HCP Terraform (Terraform Cloud)
Jira
App
Run your Terraform workspace audit from one live board

See every HCP Terraform workspace grouped by project, spot the stale, outdated and locked ones, and clean them up without leaving the page.

HCP Terraform (Terraform Cloud)
Google Sheets
App
See what Hacker News really thinks of the tools in your stack

Every tool you run or are weighing up, with the Hacker News threads that actually mattered, project health beside them, and a written verdict you keep.

Hacker News
GitHub
Notion
+1
App
A docs coverage board that catches what shipped undocumented

See everything engineering shipped next to the docs pages that cover it, so the work nobody labelled stops slipping through.

GitBook
GitHub
Slack Bot
App
A technology radar board your architecture group works out of

Every library you have adopted, are trialing, are assessing or have put on hold, on one board, with live research and a written recommendation on each card.

Context7
GitHub
Notion
App

Stop discovering variable drift during a broken apply.

Put every workspace variable on one screen, see exactly where your environments disagree, and close the gaps one approved change at a time.