● runs entirely in your browser

Terraform .tfvars Generator

Paste one or more variable block definitions, fill in a plain form built from their declared types and defaults, and get back a ready terraform.tfvars file. Nothing is ever uploaded.

How it works

Pasted text is scanned for variable "name" { ... } blocks using the same brace-matching and field extraction as the Terraform Variable & Output Extractor, pulling out each variable's type, default, and description. Each variable then gets one form field, chosen by its declared type: string becomes a text input, number a numeric input, bool a true/false dropdown, and list/set/tuple or map/object a small textarea (since those need real HCL syntax, not a single value). Whatever you type is then serialized back into a name = value line per variable — strings get wrapped in quotes with proper escaping, numbers and bools are written bare, and list/map values are passed through exactly as typed since they're already valid HCL literals. A variable declared with no default at all is flagged as required and left blank rather than guessed.

FAQ

What happens to a variable that has no default value?
It's left blank in the form and flagged with a required badge — if you don't fill in a value, it still appears in the generated .tfvars as an empty string (name = "") flagged with a '# required — no value set' comment so it's obvious nothing was supplied, rather than the generator guessing a plausible value.
Does the tool validate that the value I type actually matches the variable's declared type?
Only loosely — number fields use an HTML number input and bool fields use a true/false dropdown, so those two are hard to get wrong, but string, list, and map/object fields accept any text and are emitted into the .tfvars file exactly as typed with no HCL syntax checking, so a malformed list or map literal won't be caught until you run terraform plan.

Free, unlimited, no account. If this saved you a paid tool, a small thanks is appreciated.

Say thanks — $3