# Error: Invalid value for variable: value must be a list of strings, got a string

- **ID:** `terraform/variable-type-constraint-violation`
- **Domain:** terraform
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

A variable defined with a list type constraint was provided with a single string value instead of a list.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform v1.5.0 | active | — | — |
| Terraform v1.6.0 | active | — | — |
| Terraform v1.7.0 | active | — | — |

## Workarounds

1. **In .tfvars file, use list syntax: 'variable_name = ["value1", "value2"]'.** (95% success)
   ```
   In .tfvars file, use list syntax: 'variable_name = ["value1", "value2"]'.
   ```
2. **For environment variables, use JSON encoding: 'export TF_VAR_variable_name='["value1","value2"]''.** (90% success)
   ```
   For environment variables, use JSON encoding: 'export TF_VAR_variable_name='["value1","value2"]''.
   ```
3. **If using -var flag: 'terraform apply -var='variable_name=["value"]''.** (85% success)
   ```
   If using -var flag: 'terraform apply -var='variable_name=["value"]''.
   ```

## Dead Ends

- **** — The single string does not satisfy the list(type = list(string)) constraint. (90% fail)
- **** — Environment variables are always interpreted as strings, not lists. (80% fail)
- **** — Other parts of the configuration likely use for_each or other list-specific functions. (70% fail)
