# 错误：无效的输出值：输出值类型不匹配

- **ID:** `terraform/invalid-output-value-type`
- **领域:** terraform
- **类别:** type_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

输出值的声明类型与表达式结果的实际类型不匹配。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| Terraform v1.0+ | active | — | — |

## 解决方案

1. ```
   修正类型声明以匹配表达式：例如，如果输出是列表，将 type = string 改为 type = list(string)
   ```
2. ```
   使用 tostring()、tolist() 等函数将值转换为声明的类型
   ```

## 无效尝试

- **** — Without type constraint, output may still fail if used elsewhere expecting a specific type. (50% 失败率)
- **** — Hides the type mismatch but may cause downstream failures. (70% 失败率)
