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 patternTERRATAG_<FLAG_NAME_UPPERCASE> (for example, -tags can be set with TERRATAG_TAGS). Command-line flags take precedence over environment variables.
| Flag | Default | Description |
|---|---|---|
-tags | (required) | Tags to apply, as a valid JSON object. Example: '{"env":"prod","team":"platform"}' |
-dir | . | Directory to recursively search for .tf files |
-type | terraform | IaC 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 |
-skipTerratagFiles | true | Skip files that were previously tagged by Terratag |
-rename | true | Rename tagged files to <basename>.terratag.tf. Set to false to edit files in place |
-keep-existing-tags | false | Preserve existing tags when merging. By default, new tags override existing ones |
-default-to-terraform | false | Use Terraform even when OpenTofu is installed |
-verbose | false | Enable verbose logging |
-version | false | Print 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
- OpenTofu Project - Learn about env zero’s open-source IaC foundation.
- Managing Variables - Apply tags and labels via environment variables.
- Support - Get help from the env zero support team.