PEPAI / tools

rum-meter

Count billable HCP Terraform Resources Under Management (RUM) in a local state file, before the invoice.

The problem

HCP Terraform bills per Resource Under Management. A team sees that count on the billing page afterwards, without a per-resource explanation.

rum-meter reads a local terraform.tfstate (format v4), counts RUM from HashiCorp's definition, explains each instance, breaks the total down by module and type, and can diff two states.

Example output

$ rum-meter count tests/fixtures/v4_one_managed.json
file: tests/fixtures/v4_one_managed.json
rum: 1
not counted: R2 0, R3 0, R4 0
total rum: 1
not counted: R2 0, R3 0, R4 0
modules:
  (root): 1
types:
  random_id: 1
estimate: HCP Terraform bills the hourly peak; this is a single snapshot

Real output of the binary on a synthetic test fixture from the repository.

Install

cargo install --locked rum-meter

Needs Rust 1.85 or newer. Ready-made binaries for Linux, Windows and macOS are on the releases page.

What it deliberately does not do

Links

GitHubcrates.ioQuality
← Back to all tools