Note: This project was built with Claude Code as an experiment in AI-assisted development.
A single-binary, zero-config tool that tracks Terraform dependencies and publishes them in OTel metric format.
Why tfwatch?
A critical vulnerability is found in terraform-aws-modules/vpc/aws v5.0.0. Which of your 50+ repos still use it? A provider releases a breaking change. Who's affected?
Without tfwatch, you're grepping through repos one by one. With tfwatch, you query:
# Which repos still use the vulnerable vpc module version?
terraform_dependency_version{type="module", dependency_name="vpc", dependency_version="5.0.0"}
One query. Instant answers. Across every repo, every workspace, every environment.
Features
Auto-Detection — Reads your .tf files to detect Terraform Cloud or S3 backends automatically. No manual flags needed.
Module & Provider Tracking — Tracks every module and provider version across all repos. See which repos are behind at a glance.
OpenTelemetry Native — Publishes metrics via OTEL gRPC. Works with any OTEL-compatible backend out of the box.
Pre-Built Dashboard — Ships with a Grafana dashboard (stats, charts, searchable tables), auto-provisioned via Docker Compose.
Zero Config — Just point it at a directory and run. Backend detection, terraform init, and metric publishing happen automatically.
CI/CD Ready — Run in your pipeline with --phase apply to tag metrics by deployment stage. Single binary, no dependencies.
Package main implements tfwatch, a CLI tool that extracts Terraform
dependency metadata (modules, providers, and backend configuration) and
publishes it as OpenTelemetry metrics.
tfwatch parses the files generated by "terraform init" — modules.json,
.terraform.lock.hcl, and *.tf backend blocks — to build a dependency
inventory without executing Terraform itself.
Usage:
# List detected dependencies
tfwatch --list --dir ./infra
# Publish metrics to an OTEL collector
tfwatch --dir ./infra --otel-endpoint otel.example.com:4317
# Show version
tfwatch --version