# Terraform: Error: Invalid value for variable — "instance_type" must be a t3 type / The given value is not suitable for var.x declared at variables.tf:1,1-17: string required

**Code:** `Invalid value for input variable` · **Category:** Terraform · **Seen on:** Terraform

A variable value failed its type or `validation` block.

## Meaning

Read the condition message. Check the type (`string`, `list(string)`, `object`), validation rules, and where the value comes from (`-var`, `.tfvars`, env `TF_VAR_x`, defaults). Complex types need correct HCL in tfvars/JSON; env vars for lists/maps must be HCL-formatted strings.

## Common causes

- Value type doesn't match declaration
- Validation condition failed
- tfvars not loaded (name must be `terraform.tfvars` or `*.auto.tfvars` or passed with `-var-file`)
- TF_VAR_ environment variable with wrong format
- Variable renamed

## Quick fix

1. Fix the value/type or the validation
2. `-var-file=prod.tfvars` explicitly
3. Use `terraform console` to test expressions

## Detailed fix by platform

### Terraform

1. `terraform plan -var-file=prod.tfvars`

## How to diagnose

1. **Type** — Matches?
2. **Validation** — Passing?
3. **Source** — tfvars loaded?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/terraform/invalid-value-for-input-variable)
