Skip to main content

Terraform Variable Validator

Paste your variables.tf and catch common mistakes instantly. Validates type constraints, missing descriptions, secret handling, and type/default mismatches. Nothing is sent to any server — runs entirely in your browser.

✓ 7 validation checks ✓ Secrets & sensitive detection ✓ No data leaves your browser

Frequently Asked Questions

What does this tool validate?▼

It parses your variables.tf file and checks for missing descriptions, missing type constraints, secrets that should be marked sensitive, type/default value mismatches (e.g. a number type with a string default), required variables without defaults, and tab characters that aren't valid HCL.

What is a Terraform variable type constraint?▼

Type constraints tell Terraform what kind of value a variable expects: string, number, bool, list(string), map(string), set(string), object({...}), or tuple([...]). Without a type, Terraform infers any type, which can lead to unexpected behavior when a caller passes the wrong value type.

Why should secrets be marked sensitive = true?▼

Marking a variable sensitive = true tells Terraform to redact its value from plan output, apply output, and state display. Without it, passwords, tokens, and API keys may appear in CI/CD logs or terraform show output in plain text.

What is the difference between required and optional variables?▼

A Terraform variable without a default value is required — callers must supply it via tfvars, environment variables (TF_VAR_name), or -var flags. A variable with a default is optional. Required variables are not necessarily secrets; they're just configuration that must be explicitly set per environment.

Should I add a validation block to every variable?▼

Not necessarily. Validation blocks are most useful for variables with a constrained set of valid values (e.g. environment = 'prod' | 'staging' | 'dev') or numeric ranges (e.g. instance_count between 1 and 10). For simple strings or flags, type constraints are usually sufficient.

Does this tool send my Terraform code to a server?▼

No. All validation runs entirely in your browser using JavaScript. Your variables.tf content never leaves your machine.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →