name: cloudformation-analyzer description: 验证和分析AWS CloudFormation模板,确保其安全性和符合最佳实践 allowed-tools:
- Bash
- Read
- Write
- Glob
CloudFormation分析器技能
概述
验证和分析AWS CloudFormation模板,包括使用cfn-nag进行安全扫描、资源依赖关系分析和成本估算。
能力
- 验证CloudFormation模板
- 安全扫描(cfn-nag)
- 资源依赖关系分析
- 成本估算
- 最佳实践检查
- 支持漂移检测
- 堆栈变更集分析
目标流程
- 基础设施即代码审查
- 云架构设计
输入模式
{
"type": "object",
"required": ["templatePath"],
"properties": {
"templatePath": {
"type": "string",
"description": "CloudFormation模板路径"
},
"mode": {
"type": "string",
"enum": ["validate", "security", "cost", "all"],
"default": "all"
},
"options": {
"type": "object",
"properties": {
"parametersFile": {
"type": "string",
"description": "参数文件路径"
},
"region": {
"type": "string",
"default": "us-east-1"
},
"failOnWarning": {
"type": "boolean",
"default": false
}
}
}
}
}
输出模式
{
"type": "object",
"properties": {
"valid": {
"type": "boolean"
},
"resources": {
"type": "array",
"items": {
"type": "object",
"properties": {
"logicalId": { "type": "string" },
"type": { "type": "string" },
"dependencies": { "type": "array" }
}
}
},
"securityFindings": {
"type": "array",
"items": {
"type": "object",
"properties": {
"rule": { "type": "string" },
"severity": { "type": "string" },
"resource": { "type": "string" },
"message": { "type": "string" }
}
}
},
"estimatedCost": {
"type": "object",
"properties": {
"monthly": { "type": "number" },
"breakdown": { "type": "array" }
}
}
}
}
使用示例
{
kind: 'skill',
skill: {
name: 'cloudformation-analyzer',
context: {
templatePath: 'infrastructure/main.yaml',
mode: 'all',
options: {
region: 'us-east-1'
}
}
}
}