finds.dev← search

// the find

env0/terratag

★ 1,053 · Go · MPL-2.0 · updated Jul 2026

Terratag is a CLI tool that enables users of Terraform to automatically create and maintain tags across their entire set of AWS, Azure, and GCP resources

Terratag is a Go CLI that rewrites your Terraform/OpenTofu HCL files to inject tags into every taggable resource across AWS, GCP, and Azure. It works by parsing your `.tf` files, merging new tags via `locals` blocks, and writing out `.terratag.tf` replacements — so you can retrofit consistent tagging onto existing IaC without touching each resource by hand. Useful for teams that inherited untagged infrastructure and need cost allocation or compliance tags applied at scale.

Produces readable, diff-able output rather than opaque state mutations — the `.terratag.tf` files are valid HCL you can inspect and commit. The `-filter` and `-skip` regex flags give you surgical control over which resource types get tagged, which matters when some resources (like IAM) don't support arbitrary tags. It uses the provider schema (via `terraform init`) to know which resources actually support tags, rather than blindly trying to tag everything and hoping for the best. Terragrunt support is a real addition — most tagging tools pretend Terragrunt doesn't exist.

The HCL rewriting approach is fragile at the edges: it generates `merge(map(...), local.terratag_added_main)` syntax that works in older Terraform but is deprecated in favor of `merge({...}, local...)` in current versions, and the test fixtures show it's been playing catch-up with HCL syntax changes for years. It requires `terraform init` to run first to pull the provider schema, which means you need provider credentials or network access just to tag files — annoying in CI. The azapi provider support was bolted on via a Python script that generates a CSV of supported resources, which is a code smell that will drift as the azapi provider evolves. With only 48 forks and a mostly env0-internal contributor history, edge cases in less-common resource types will likely just not work without you filing an issue and waiting.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →