📦 Terraform Cost Estimator
v1.0.0从Terraform计划中估算基础设施成本 —— 分析资源变化,预测每月支出,比较替代方案,并找出成本优化机会...
0· 0·0 当前·0 累计
运行时依赖
无特殊依赖
版本
latestv1.0.0
### 成本明细
安装命令
点击复制官方npx clawhub@latest install terraform-cost-estimator
镜像加速npx clawhub@latest install terraform-cost-estimator --registry https://cn.longxiaskill.com✓ 镜像可用
技能文档
Terraform 成本估算器 从 Terraform 计划中估算基础设施成本,在应用之前。分析计划的资源更改,预测每月支出影响,比较价格替代方案,并找出成本优化机会。支持 AWS、GCP 和 Azure 资源。
用法 “估算此 Terraform 计划的成本” “此基础设施更改的成本是多少?” “比较不同实例类型的成本,用于我的 Terraform 配置” “在我的 Terraform 模块中找到成本优化”
工作原理
- 计划分析
- 资源定价
- 成本影响报告
- 优化建议
输出
Terraform 成本估算
提供商: AWS (us-east-1) 资源: 12 个计划更改成本明细
| 资源 | 类型 | 操作 | 每月成本 |
|---|---|---|---|
| web-server | aws_instance (t3.large) | 创建 | $60.74 |
| db-primary | aws_db_instance (db.r6g.xl) | 创建 | $345.60 |
| db-replica | aws_db_instance (db.r6g.large) | 创建 | $172.80 |
| cache | aws_elasticache (r6g.large) | 创建 | $131.40 |
| alb | aws_lb | 创建 | $22.27 |
| nat | aws_nat_gateway | 创建 | $32.40 |
| s3-assets | aws_s3_bucket (100GB est) | 创建 | $2.30 |
| 总计 | $767.51/mo |
优化机会
- NAT 网关 → VPC 端点:节省 $25/mo
- db.r6g.xlarge → db.r6g.large + 只读副本:如果读取量大,节省 $50/mo
- 考虑预留实例:节省 30-40%(约 $230/mo)
- S3 智能分层:节省 20-40% 的不常访问存储
年度预测
- 按需:$9,210/yr
- 带 1 年预留:$6,447/yr(节省 30%)
- 带 3 年预留:$5,526/yr(节省 40%)