A zero-config Terraform wrapper that automatically injects Git metadata as variables. Works transparently with any Terraform command.
curl -fsSL https://raw.githubusercontent.com/trupositive/trupositive/main/install.sh | bashEnsure ~/.local/bin is in your PATH:
export PATH="$HOME/.local/bin:$PATH"curl -fsSL https://raw.githubusercontent.com/trupositive/trupositive/main/uninstall.sh | bashUse terraform as normal - the wrapper is transparent:
terraform apply
terraform plan
terraform destroyGenerate Terraform configuration for automatic tagging:
trupositive initThis creates trupositive.auto.tf with provider-specific tagging configuration. The tool automatically detects AWS, Azure, or GCP providers.
The wrapper exports Git metadata as Terraform variables:
TF_VAR_git_sha- Current commit SHATF_VAR_git_branch- Current branch nameTF_VAR_git_repo- Remote origin URL
AWS: Uses provider-level default_tags - tags applied automatically to all resources.
Azure/GCP: Generates locals blocks - add tags = local.default_tags (or labels = local.default_labels for GCP) to resources manually.
Automatically detects branch names from CI environment variables (GitHub Actions, GitLab CI, Azure DevOps, Jenkins).
- Git repository
- Terraform installed
- Bash shell
Contributions welcome! See CONTRIBUTING.md for guidelines.
Report security issues to SECURITY.md.