# 资源创建已取消：资源创建在 60 分钟后超时 (AWS::CloudFormation::Stack)

- **ID:** `aws/cloudformation-stack-creation-timeout`
- **领域:** aws
- **类别:** runtime_error
- **验证级别:** ai_generated
- **修复率:** 85%

## 根因

CloudFormation 堆栈创建超过了默认的 60 分钟超时，通常是由于资源预配缓慢（例如大型 RDS 实例、复杂的嵌套堆栈）。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| CloudFormation API 2010-05-15 | active | — | — |
| AWS CLI 2.13.0 | active | — | — |

## 解决方案

1. ```
   使用 CloudFormation 控制台或 CLI 增加堆栈创建超时时间：'aws cloudformation create-stack --stack-name my-stack --template-body file://template.yaml --timeout-in-minutes 120'。根据预期的预配持续时间设置适当的值。
   ```
2. ```
   优化 CloudFormation 模板：将大型堆栈拆分为具有单独超时的嵌套堆栈，或谨慎使用 'DependsOn' 以减少顺序依赖。考虑对长时间运行的资源创建使用 'AWS::CloudFormation::WaitCondition' 并设置自定义超时。
   ```

## 无效尝试

- **** — Simply retrying the stack creation without increasing timeout or optimizing resource provisioning will hit the same timeout again. (95% 失败率)
- **** — Deleting the failed stack and recreating it with the same template doesn't address the root cause; the timeout will recur. (80% 失败率)
