A CLI tool that scans Terraform configurations and generates variable definition templates in multiple formats.
tfvar is a Terraform variable definitions template generator. It scans Terraform configurations or modules, extracts declared input variables, and produces templates in formats like .tfvars, environment variables, or Terraform Enterprise resources. It solves the problem of manually creating and maintaining variable definition files, especially in complex modules with many inputs.
Terraform users and DevOps engineers who work with multiple Terraform modules or need to consistently populate variable values across different environments.
Developers choose tfvar because it automates a repetitive and error-prone task, supports multiple output formats for different workflows (local, CI/CD, Terraform Cloud/Enterprise), and integrates seamlessly with Terraform's existing variable precedence system.
Terraform's variable definitions template generator.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates templates in .tfvars, environment variable exports, Terraform Enterprise resources, and Terraform Cloud API payloads, catering to diverse deployment workflows as shown in the README examples.
Mirrors Terraform's variable precedence with --var and --var-file flags, ensuring consistency with existing CLI practices and reducing learning curve.
The --auto-assign option pulls values from terraform.tfvars and environment variables, streamlining setup by minimizing manual entry errors.
Offers --ignore-default to exclude variable defaults, allowing for clean templates when defaults are not desired, as demonstrated in the usage examples.
Only extracts input variables and ignores outputs, providers, or other Terraform elements, necessitating additional tools for full module documentation.
Does not validate variable types or values against Terraform schemas, which could lead to runtime errors if incorrect values are used without proper checks.
Useful only for Terraform projects, with no support for other infrastructure-as-code platforms, limiting its applicability in mixed environments.