PR Cost Review
Pre-merge cost analysis — prices Terraform changes against live provider pricing, evaluates policy, and comments on the pull request before the change is merged.
At a glance
| Route | /pr-cost-diff |
| Group | Govern |
| Page permission | pr_cost_diff |
What it is
Pre-merge cost analysis. It reads the Terraform changes in a pull request, prices each resource against live provider pricing, evaluates policy, calculates budget impact, and publishes the result as a comment on the pull request before the change is merged.
Who it is for
Every engineer opening an infrastructure pull request — plus the platform and FinOps teams who set the policies it enforces.
How it works
Complete pricing coverage
Resources are priced using the live AWS Pricing API, with a heuristic fallback so coverage is complete rather than partial.
Read the confidence score
Low confidence indicates pricing fell back to heuristics, and the figure should be treated as indicative rather than precise. High confidence means it came from live pricing.
Prevention made visible
A prevention view and a backfill capability report what the module has stopped — which is how the value of a preventive control becomes visible at all.
Features
- Terraform resource change extraction from pull request diffs
- Live pricing valuation with heuristic fallback for complete coverage
- Policy evaluation covering tags, blocked resources, cost thresholds, and risk
- Budget impact projection against configured guardrails
- Cost delta, risk score, confidence score, and pass/advisory/block decision
- Automatic GitHub pull request comment publication
- Direct file analysis for use outside a pull request
- Repository settings with per-repository configuration and branch selection
- GitHub permission diagnostics
- Terraform Cloud webhook integration
- Validation history and a prevention view with backfill
- Public pricing estimate endpoint for unauthenticated estimation
How to use it
Install the GitHub App
From Integrations, and confirm the permission check passes.
Configure repository settings
Selecting which repositories and branches are analysed.
Author the policies to enforce
In Policies — starting in advisory mode.
Open a test pull request with a known infrastructure change
Confirm the comment appears with a sensible cost delta before relying on it.
Read the confidence score on each result
Low confidence means heuristic pricing. Treat those figures as indicative.
Promote proven policies to blocking
Once they are proven, so genuinely costly changes cannot merge unreviewed.
Review the prevention view periodically
It is the evidence that the control is working — and otherwise the hardest kind of value to demonstrate.
Install the VS Code extension for engineers who want it earlier
See VS Code Extension — cost feedback before a pull request even exists.
Why it matters
This is cost governance shifted left, and it is where the economics are most favourable.
The economics of when you find out
Discovering a $15,000/month cost increase two weeks after it shipped means paying for those two weeks and funding an engineer to unwind it.
Seeing the same number in pull request review costs nothing and takes thirty seconds.
The prevention view makes that avoided cost visible, which is otherwise the hardest kind of value to demonstrate to a finance stakeholder.
Connects to
- Policies authored in Policies; budget guardrails shared with Overview
- GitHub integration shared with CI/CD Control Tower and Deploy & Migration
- Pricing shared with Cloud Playground
- Tag requirements come from Tag Governance
- The editor extension is documented in VS Code Extension