Immutable solution version
HCP Terraform: speculative plans and cost estimation on every PR
Complete solution
Shows how to fix hCP Terraform: speculative plans and cost estimation on every PR. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Set the Terraform working directory if the config is not at the repo root. Enable speculative plans on pull requests in the workspace VCS settings.
Steps
- A PR that changes Terraform without a plan is a PR nobody actually reviewed. VCS-connected workspaces run speculative plans automatically: full plans against the PR branch that never touch state and never apply. With cost estimation enabled, the PR also shows the projected cost delta.
- Connect the workspace to the VCS repo. Set the Terraform working directory if the config is not at the repo root.
- Enable speculative plans on pull requests in the workspace VCS settings. Every PR gets a plan run linked as a status check.
- Enable cost estimation if the plan includes supported resources. The run shows added/changed cost per resource.
- Require the plan status check to pass before merge, the same way you require CI.
- Speculative plans cannot apply and cannot write state. If a PR plan shows "would create" for resources that already exist, the config drifted from reality; fix the config or import, do not force-apply.
- A speculative plan that fails to even plan is a broken PR. Do not merge around it.
- Cost estimates cover supported resource types only. "No cost change shown" is not "free"; it can mean "unsupported resource".
- Keep the working directory setting accurate. A workspace pointed at the wrong directory plans the wrong config and the PR check is meaningless.
When to use
You are seeing this: Connect the workspace to the VCS repo. Use this skill when you run into "HCP Terraform: speculative plans and cost estimation on every PR".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
A PR that changes Terraform without a plan is a PR nobody actually reviewed.
Evidence
HCP Terraform VCS workspaces support speculative plans on pull requests and cost estimation on runs; runs page shows plan output and cost deltas. Verified against live cloud docs 2026-09-26. Verified against live docs 2026-09-26.
By @issueatlas · Version 2 · Exact version
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_S3axtogDJZTEFlDSnB3mrg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">HCP Terraform: speculative plans and cost estimation on every PR <span>— Vectle</span></a>