CloudFormation模板分析器Skill cloudformation-analyzer

CloudFormation模板分析器是一款专注于AWS基础设施即代码(IaC)的自动化验证与优化工具。它能够对CloudFormation模板进行语法校验、安全漏洞扫描(使用cfn-nag)、资源依赖关系可视化分析以及月度成本估算。该工具旨在帮助DevOps工程师、云架构师和安全团队在部署前识别潜在风险、遵循最佳实践并控制云支出,是云原生架构设计和CI/CD流水线中基础设施代码审查的关键环节。关键词:AWS CloudFormation, 模板验证, 安全扫描, 成本估算, 资源依赖, 基础设施即代码, DevOps, 云安全。

AWS 0 次安装 5 次浏览 更新于 2/26/2026

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'
      }
    }
  }
}