Skip to content
100% local

Terraform variable extractor

List every variable block in a Terraform file with its type, default and whether it is required.

Input
Output

Terraform variable extractor

Paste Terraform (HCL) code and this tool scans every `variable` block and lists its name, type, description, default value, and whether it is required or marked sensitive. It is built for the moment you inherit a module with dozens of variables and no documentation, or you need a checklist of exactly what a root module expects before you can run it.

Choose how the result is shaped with the output option: a table for a quick overview, a tfvars file you can drop straight into a working directory, or Markdown documentation ready to paste into a README. "Only required variables" narrows the list to the ones with no default, which is usually the shortest path to knowing what you actually have to supply. "Include sensitive variables" lets you drop anything marked `sensitive = true` when you are producing something you might share more widely. Sort the list by name or keep the order variables appear in the file, and switch how values are written between native HCL syntax and JSON with the value format option.

The tfvars output can pre-fill each line with the variable's own default value, or leave every line commented out as a template you fill in by hand — useful when you want a starting point without silently carrying defaults forward. Descriptions, types and nested type expressions like `object({...})` are read as written; the parser does not evaluate Terraform expressions, so a default that references another variable or a function call is shown as the raw expression rather than a computed value.

Everything runs locally in your browser — your Terraform code, including any variable names or defaults you consider sensitive, is never uploaded anywhere. When you are done, copy the result, download it as a .txt file, or send the output back into the input to keep refining it.

FAQ

Which Terraform constructs does it understand?
It looks specifically for `variable "name" { ... }` blocks and reads their `type`, `description`, `default` and `sensitive` attributes. Resource, module, output and other block types are skipped, and nested blocks like `validation` inside a variable are ignored.
How does it decide whether a variable is required?
A variable is treated as required when its block has no `default` attribute at all — the same rule Terraform itself uses to demand a value from the caller.
Does it evaluate expressions in default values?
No. A default that is a plain literal (string, number, boolean, list or map) is parsed into that value; anything else, such as a reference to another variable or a function call, is shown exactly as written.
What is the difference between the tfvars and Markdown outputs?
The tfvars output is a template file with `name = value` assignments and comments, ready to save as a `.tfvars` file. The Markdown output is prose documentation — one heading per variable with its type, requirement and default listed underneath — meant for a README or wiki page.
Is my Terraform code uploaded anywhere?
No. Extraction runs entirely in your browser — your code, variable names and default values never leave your device.