# Terraform: Error: Invalid character — This character is not used within the language / Error: Argument or block definition required

**Code:** `Invalid character / Argument or block definition required` · **Category:** Terraform · **Seen on:** Terraform

The `.tf` file has HCL syntax errors (stray characters, bad quotes, missing braces/commas).

## Meaning

The error gives file/line/column. Common: curly quotes pasted from docs (`“ ”`), missing `=`, JSON-style colons, trailing commas, unclosed braces, using `:` instead of `=`, or interpolation syntax errors. Run `terraform fmt` and `terraform validate`; editors with HCL plugins highlight issues.

## Common causes

- Smart quotes copied from web/docs
- Missing `=` or braces
- JSON syntax inside HCL
- Unescaped `${` in strings (`$${`)
- Wrong block nesting

## Quick fix

1. Replace smart quotes with straight quotes
2. `terraform fmt -check -diff && terraform validate`
3. Fix the line/column named

## Detailed fix by platform

### Terraform

1. `terraform fmt -check -diff && terraform validate`

## How to diagnose

1. **Line** — File and line?
2. **Quotes** — Straight?
3. **Syntax** — HCL?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/invalid-character-or-syntax-error-in-tf-file)
