Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.envzero.com/llms.txt

Use this file to discover all available pages before exploring further.

Terratag

Terratag is a CLI tool developed by env zero that applies tags or labels across your Infrastructure-as-Code (IaC) codebase. Terratag automatically applies consistent tags to AWS, GCP, and Azure resources across your Terraform or Terragrunt files.

Getting started

Visit the official Terratag website to download the binary and view additional documentation.

Visit Terratag

Download Terratag and view full documentation

CLI flags

All flags can also be set via environment variables using the pattern TERRATAG_<FLAG_NAME_UPPERCASE> (for example, -tags can be set with TERRATAG_TAGS). Command-line flags take precedence over environment variables.
FlagDefaultDescription
-tags(required)Tags to apply, as a valid JSON object. Example: '{"env":"prod","team":"platform"}'
-dir.Directory to recursively search for .tf files
-typeterraformIaC type. Valid values: terraform, terragrunt, terragrunt-run-all
-filter.*Apply tags only to resource types matching this regex
-skip(none)Exclude resource types matching this regex from tagging
-skipTerratagFilestrueSkip files that were previously tagged by Terratag
-renametrueRename tagged files to <basename>.terratag.tf. Set to false to edit files in place
-keep-existing-tagsfalsePreserve existing tags when merging. By default, new tags override existing ones
-default-to-terraformfalseUse Terraform even when OpenTofu is installed
-verbosefalseEnable verbose logging
-versionfalsePrint the version and exit
Terratag is part of the env zero platform ecosystem and integrates with env zero’s Infrastructure-as-Code management capabilities.

Next steps