Unsupported argument — typo or misplaced attribute
An argument named "instance_typo" is not expected here
Focused incident mode — strips away everything but this runbook.
Symptoms
- An argument named "instance_typo" is not expected here
- terraform validate fails with unexpected argument
- HCL syntax error after editing a resource block
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Validation error message
terraform validate 2>&1File and line number
terraform validate 2>&1 | grep -E 'on|line'
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- Error names the exact misspelled argument
- e.g. instance_typo instead of instance_type
Confirm before fixing
terraform validate 2>&1Get the exact error location
Fix
sed -i 's/instance_typo/instance_type/g' <FILE>.tfFix the typo in the resource block
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
terraform validate 2>&1Get the exact error location
grep -n '<BAD_ARG>' <FILE>.tfFind the typo in the file
terraform fmt -diff <FILE>.tfAuto-format to clean up formatting issues
terraform validateConfirm the fix
Prevention
- Use terraform validate in CI on every PR.
- Use language server (tfls) in your editor for real-time HCL validation.
- Pin provider versions to avoid attribute removal surprises on upgrade.
- Run terraform fmt -check in CI to enforce consistent formatting.
Related runbooks
Same stack, same failure family — worth a skim.
The given "for_each" argument value is unsuitable: must be a map, or set of strings
Error: resource <type> requires version X.Y.Z but provider only has version A.B.C
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.