All Tools View Categories About Contact Privacy

Required Variable Checker

Find variables without defaults that are not set in your .tfvars.

Runs entirely in your browser - nothing is uploaded and no cloud connection is made.
0
required
0
set
0
missing
Your variable report will appear here.

About Required Variable Checker

Terraform variables can be declared with or without default values. A variable that has no default is required: Terraform will prompt for it, or fail the run, unless it is supplied through -var, a .tfvars file, or an environment variable. On large modules with dozens of variables spread across several files, it is easy to lose track of which inputs must be provided and which are optional, leading to surprising plan-time prompts or, worse, variables that are declared but never actually used and only add confusion for readers and maintainers of the code.

The Required Variable Checker analyses your Terraform configuration and reports exactly which variables are required, which have defaults, and which appear to be unused. Paste your variables.tf and the rest of the module, and the tool parses the HCL to build a clear inventory. It separates required from optional, flags variables that are declared but never referenced, and lists variables referenced only in conditional or sensitive contexts. The analysis runs entirely in your browser, so your configuration is never uploaded and stays on your machine at all times and away from any network.

Use it before publishing a module, before a refactor, or as a teaching aid to understand how Terraform resolves inputs across a project and where dead declarations should be removed to keep the public interface honest and easy to consume by callers. Running the check regularly keeps a large module honest as new variables are added by different contributors over time. It also helps reviewers trust that a module will not prompt for missing inputs during a critical deploy.

Features

  • Required detection - lists every variable with no default value set at all.
  • Optional detection - lists variables that already have default values declared.
  • Unused detection - flags variables declared but never referenced anywhere in the module.
  • Sensitive awareness - notes variables marked sensitive = true for extra care.
  • Type summary - shows each variable type and default where one is present in code.
  • Reference scan - counts how many times each variable is used across the module.
  • Multiple files - paste a whole module, not just variables.tf alone for accuracy.
  • Copyable report - export the findings as markdown or plain text for sharing.
  • Live stats - a summary row of required, optional and unused counts you can scan.
  • Private - parsing happens in the browser, nothing is sent to a server.
  • Clear output - grouped lists, not a single wall of confusing text.
  • Actionable - concrete hints on what to fix next in the module.

How to Use

  1. Paste your module - variables.tf plus any other .tf files that use them.
  2. Click Check variables to parse the HCL you provided in the box.
  3. Read the required list - these must be supplied at apply time without fail.
  4. Read the optional list - these already have defaults you can still override.
  5. Inspect unused variables and decide whether to remove or wire them up.
  6. Review the stats row for a quick required or optional or unused tally.
  7. Resolve any errors such as unparseable HCL in one of your files.
  8. Copy or download the report for your PR description or team runbook.
  9. Delete dead variables flagged as unused after confirming they are truly dead.
  10. Re-run after edits to confirm the module is clean and complete again.

Examples

Worked example - a module with drift. Paste a module where region has no default, instance_count defaults to 1, and a legacy tag variable is declared but never referenced. The checker reports region as required, instance_count as optional with default 1, and tag as unused with a hint to delete it. The stats row shows one required, one optional and one unused, giving you an immediate picture before you open a pull request, and the unused flag tells you exactly which declaration to remove from the file.

Benefits

  • Clear contracts - know exactly what callers must pass in to your module.
  • Cleaner modules - spot and remove dead, unused variables confidently.
  • Fewer failed plans - supply every required input on the first attempt.
  • Documentation - the report doubles as variable documentation for users.
  • Learning - see how Terraform resolves inputs across many files.
  • Private - configuration never leaves the browser session at any point.
  • Review speed - a quick required-or-optional verdict for human reviewers.

Frequently Asked Questions

What does this check?
It reads your variable blocks, finds those without a default (i.e. required), and checks whether each is assigned in the provided .tfvars text. Unassigned required variables are flagged as errors.
How do I provide tfvars?
Paste the contents of a .tfvars file (name = value lines) into the second box. A terraform.tfvars or *.auto.tfvars has the same format.
Does it run terraform?
No. It parses the text locally and never executes Terraform or connects to anything.
What about variables with defaults?
They are not required and are ignored for the missing-set check.
Can I export the report?
Yes. Copy, download as .md, or print.