Configuration
Terratags requires a configuration file that specifies which tags must be present on your AWS resources. This file can be in either YAML or JSON format.
Required Tags Configuration
YAML Format
JSON Format
Command Options
Terratags supports the following command-line options:
-config
,-c
: Path to the config file (JSON/YAML) containing required tag keys (required)-dir
,-d
: Path to the Terraform directory to analyze (default: current directory)-verbose
,-v
: Enable verbose output-log-level
,-l
: Set logging level: DEBUG, INFO, WARN, ERROR (default: ERROR)-plan
,-p
: Path to Terraform plan JSON file to analyze-report
,-r
: Path to output HTML report file-remediate
,-re
: Show auto-remediation suggestions for non-compliant resources-exemptions
,-e
: Path to exemptions file (JSON/YAML)-help
,-h
: Show help message-version
,-V
: Show version information
Configuration Best Practices
- Start Simple: Begin with a small set of required tags and gradually expand
- Be Consistent: Use consistent naming conventions for your tags
- Document Purpose: Include comments in your configuration files explaining the purpose of each tag
- Version Control: Keep your configuration files in version control
- Team Alignment: Ensure your team understands the tagging requirements