# Error: Invalid index: output value is a list but no index was specified

- **ID:** `terraform/invalid-index-in-output`
- **Domain:** terraform
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

A module output that returns a list is referenced without an index, causing a type mismatch when Terraform expects a single value.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Terraform >=1.0 | active | — | — |
| AWS Provider 5.x | active | — | — |

## Workarounds

1. **Reference the output with an explicit index, e.g., `module.my_module.output_name[0]` or use `element(module.my_module.output_name, 0)`.** (90% success)
   ```
   Reference the output with an explicit index, e.g., `module.my_module.output_name[0]` or use `element(module.my_module.output_name, 0)`.
   ```
2. **If you need all values, use `module.my_module.output_name[*]` to preserve the list type.** (85% success)
   ```
   If you need all values, use `module.my_module.output_name[*]` to preserve the list type.
   ```

## Dead Ends

- **** — Outputs do not support count; this fix leads to a syntax error. (60% fail)
- **** — Alters the module's contract and may cause downstream errors. (70% fail)
