# InvalidParameterValue：队列 'my-queue' 的重驱策略无效。原因：死信队列 ARN 无效。

- **ID:** `cloud/aws-sqs-redrive-policy-invalid`
- **领域:** cloud
- **类别:** config_error
- **错误码:** `InvalidParameterValue`
- **验证级别:** ai_generated
- **修复率:** 88%

## 根因

重驱策略中指定的死信队列 ARN 不存在、位于不同区域，或者源队列没有向其发送消息的权限。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| AWS SDK for Python (boto3): 1.34.0 | active | — | — |
| SQS: 2012-11-05 | active | — | — |
| Terraform AWS Provider: 5.70.0 | active | — | — |

## 解决方案

1. ```
   使用 AWS CLI 验证死信队列 ARN：aws sqs get-queue-attributes --queue-url <DLQ_URL> --attribute-names QueueArn。然后使用正确的 ARN 更新重驱策略。
   ```
2. ```
   向死信队列附加基于资源的策略，允许源队列发送消息：aws sqs set-queue-attributes --queue-url <DLQ_URL> --attributes Policy='{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":"*","Action":"sqs:SendMessage","Resource":"<DLQ_ARN>","Condition":{"ArnEquals":{"aws:SourceArn":"<SOURCE_ARN>"}}}]}'
   ```
3. ```
   确保两个队列位于同一 AWS 区域；如果不在，则在源队列所在区域创建新的死信队列。
   ```

## 无效尝试

- **** — Recreating queues does not fix the ARN mismatch or permission issue; the new queues have different ARNs unless explicitly specified. (80% 失败率)
- **** — This only delays the problem; messages still get stuck in the source queue if processing fails repeatedly, and the redrive policy remains invalid. (90% 失败率)
- **** — The redrive policy requires an ARN, not a URL; using a URL causes the same invalid parameter error. (95% 失败率)
