mcpField
C
cloud-architect

cloud-architect

github.com/jeffallan云与 DevOps12.1k4.7k 次安装今天更新
代码仓库

关于 cloud-architect

cloud-architect 是供团队评估、构建、迁移和运营云系统的架构设计技能,涵盖安全、成本、弹性、迁移验证和运维,并提供 AWS、Azure 与 GCP 参考资料。

主要功能

  1. 01云发现与设计工作流
  2. 02AWS、Azure 和 GCP 参考
  3. 03安全与最小权限模式
  4. 04成本建模与优化
  5. 05迁移、监控与灾难恢复

适用场景

  1. 01评估云需求与限制
  2. 02设计安全且具冗余的基础设施
  3. 03规划云迁移及切换检查
  4. 04审查成本与灾难恢复方案

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/jeffallan/claude-skills --skill cloud-architect

安装后在 Claude Code 中输入/cloud-architect确认已加载。

包含的文件

除 SKILL.md 外,安装时一起下载的参考资料和脚本。

references/
aws.md
azure.md
cost.md
gcp.md
multi-cloud.md

详细介绍

云架构师

核心工作流

  1. 发现 — 评估当前状态、需求、约束和合规要求
  2. 设计 — 选择服务、设计拓扑、规划数据架构
  3. 安全 — 实施零信任、身份联合和加密
  4. 成本模型 — 合理配置资源规模、预留容量、自动扩缩
  5. 迁移 — 应用 6Rs 框架、定义迁移波次,并在切换前验证连接
  6. 运维 — 设置监控和自动化,持续优化
工作流验证检查点

设计后: 确认每个组件都有冗余策略,且拓扑中不存在单点故障。

迁移切换前: 验证 VPC 对等连接或网络连接已完全建立:

# AWS: confirm peering connection is Active before proceeding
aws ec2 describe-vpc-peering-connections \
  --filters "Name=status-code,Values=active"

# Azure: confirm VNet peering state
az network vnet peering list \
  --resource-group myRG --vnet-name myVNet \
  --query "[].{Name:name,State:peeringState}"

迁移后: 验证应用健康状况和路由:

# AWS: check target group health in ALB
aws elbv2 describe-target-health \
  --target-group-arn arn:aws:elasticloadbalancing:...

DR 测试后: 确认已达到 RTO/RPO 目标;记录实际恢复时间。

参考指南

根据上下文加载详细指南:

主题参考文档加载时机
AWS 服务references/aws.mdEC2、S3、Lambda、RDS、Well-Architected Framework
Azure 服务references/azure.mdVMs、Storage、Functions、SQL、Cloud Adoption Framework
GCP 服务references/gcp.mdCompute Engine、Cloud Storage、Cloud Functions、BigQuery
多云references/multi-cloud.md抽象层、可移植性、缓解供应商锁定
成本优化references/cost.md预留实例、竞价型实例、合理配置资源规模、FinOps 实践

约束

必须做到
  • 以高可用性(99.9%+)为目标进行设计
  • 按设计实现安全(零信任)
  • 使用基础设施即代码(Terraform、CloudFormation)
  • 启用成本分配标签和监控
  • 制定灾难恢复计划并定义 RTO/RPO
  • 为关键工作负载实施多区域部署
  • 尽可能使用托管服务
  • 记录架构决策
绝不能
  • 在代码或公开仓库中存储凭据
  • 跳过加密(静态数据和传输中数据)
  • 创建单点故障
  • 忽视成本优化机会
  • 未配置适当监控就部署
  • 使用过于复杂的架构
  • 忽视合规要求
  • 跳过灾难恢复测试

常见模式示例

最小权限 IAM(零信任)

不要使用宽泛策略,而应将权限限定为特定资源和操作:

# AWS: create a scoped role for an application
aws iam create-role \
  --role-name AppRole \
  --assume-role-policy-document file://trust-policy.json

aws iam put-role-policy \
  --role-name AppRole \
  --policy-name AppInlinePolicy \
  --policy-document '{
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject"],
      "Resource": "arn:aws:s3:::my-app-bucket/*"
    }]
  }'
# Terraform equivalent
resource "aws_iam_role" "app_role" {
  name               = "AppRole"
  assume_role_policy = data.aws_iam_policy_document.trust.json
}

resource "aws_iam_role_policy" "app_policy" {
  role = aws_iam_role.app_role.id
  policy = jsonencode({
    Version = "2012-10-17"
    Statement = [{
      Effect   = "Allow"
      Action   = ["s3:GetObject", "s3:PutObject"]
      Resource = "${aws_s3_bucket.app.arn}/*"
    }]
  })
}
采用公有/私有子网的 VPC(Terraform)
resource "aws_vpc" "main" {
  cidr_block           = "10.0.0.0/16"
  enable_dns_hostnames = true
  tags = { Name = "main", CostCenter = var.cost_center }
}

resource "aws_subnet" "private" {
  count             = 2
  vpc_id            = aws_vpc.main.id
  cidr_block        = cidrsubnet("10.0.0.0/16", 8, count.index)
  availability_zone = data.aws_availability_zones.available.names[count.index]
}

resource "aws_subnet" "public" {
  count                   = 2
  vpc_id                  = aws_vpc.main.id
  cidr_block              = cidrsubnet("10.0.0.0/16", 8, count.index + 10)
  availability_zone       = data.aws_availability_zones.available.names[count.index]
  map_public_ip_on_launch = true
}
自动扩缩组(Terraform)
resource "aws_autoscaling_group" "app" {
  desired_capacity    = 2
  min_size            = 1
  max_size            = 10
  vpc_zone_identifier = aws_subnet.private[*].id

  launch_template {
    id      = aws_launch_template.app.id
    version = "$Latest"
  }

  tag {
    key                 = "CostCenter"
    value               = var.cost_center
    propagate_at_launch = true
  }
}

resource "aws_autoscaling_policy" "cpu_target" {
  autoscaling_group_name = aws_autoscaling_group.app.name
  policy_type            = "TargetTrackingScaling"
  target_tracking_configuration {
    predefined_metric_specification {
      predefined_metric_type = "ASGAverageCPUUtilization"
    }
    target_value = 60.0
  }
}
成本分析 CLI
# AWS: identify top cost drivers for the last 30 days
aws ce get-cost-and-usage \
  --time-period Start=$(date -d '30 days ago' +%Y-%m-%d),End=$(date +%Y-%m-%d) \
  --granularity MONTHLY \
  --metrics "UnblendedCost" \
  --group-by Type=DIMENSION,Key=SERVICE \
  --query 'ResultsByTime[0].Groups[*].{Service:Keys[0],Cost:Metrics.UnblendedCost.Amount}' \
  --output table

# Azure: review spend by resource group
az consumption usage list \
  --start-date $(date -d '30 days ago' +%Y-%m-%d) \
  --end-date $(date +%Y-%m-%d) \
  --query "[].{ResourceGroup:resourceGroup,Cost:pretaxCost,Currency:currency}" \
  --output table

输出模板

设计云架构时,请提供:

  1. 展示服务和数据流的架构图
  2. 服务选择依据(计算、存储、数据库、网络)
  3. 安全架构(IAM、网络分段、加密)
  4. 成本估算和优化策略
  5. 部署方案和回滚计划

由 @jeffallan 维护,他是 Synergetic Solutions 的首席顾问。

文档

评论

支持 Markdown