aws-cloud-ops

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AWS Cloud Operations Skill

AWS云运维Skill

Installation

安装

The skill invokes the AWS CLI v2. Install and configure:
  • Linux x86: Download AWS CLI v2, unzip, then
    sudo ./aws/install
  • macOS:
    curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
    then run the installer
  • Windows: Download MSI from AWS CLI v2 or use
    msiexec
    ; or install via package managers
Configure:
aws configure
(access key, secret, region). Verify:
aws --version
该Skill调用AWS CLI v2。请安装并配置:
  • Linux x86:下载AWS CLI v2,解压后执行
    sudo ./aws/install
  • macOS:执行
    curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
    ,然后运行安装程序
  • Windows:从AWS CLI v2下载MSI安装包,或使用
    msiexec
    ;也可通过包管理器安装
配置:执行
aws configure
(输入访问密钥、密钥、区域)。验证:执行
aws --version

Cheat Sheet & Best Practices

速查表与最佳实践

Identity & config:
aws sts get-caller-identity
— who am I;
aws configure list-profiles
— list profiles.
S3:
aws s3 ls
;
aws s3 cp <local> s3://bucket/
;
aws s3 sync ./dir s3://bucket/
;
aws s3 rm s3://bucket/key
.
Lambda:
aws lambda list-functions
;
aws lambda invoke --function-name X output.json
;
aws lambda get-function --function-name X
.
CloudWatch:
aws cloudwatch list-metrics
;
aws cloudwatch get-metric-statistics
;
aws cloudwatch describe-alarms
;
put-metric-alarm
for alerts.
EC2:
aws ec2 describe-instances
;
start-instances
/
stop-instances
/
terminate-instances
with
--instance-ids
.
Best practices: Use IAM roles over long-lived keys; set
AWS_REGION
/
AWS_PROFILE
; use
--output json
and
--query
to limit response size; run destructive ops only after
describe
to confirm resources.
身份与配置
aws sts get-caller-identity
—— 查看当前身份;
aws configure list-profiles
—— 列出配置文件。
S3
aws s3 ls
aws s3 cp <本地路径> s3://bucket/
aws s3 sync ./dir s3://bucket/
aws s3 rm s3://bucket/key
Lambda
aws lambda list-functions
aws lambda invoke --function-name X output.json
aws lambda get-function --function-name X
CloudWatch
aws cloudwatch list-metrics
aws cloudwatch get-metric-statistics
aws cloudwatch describe-alarms
;使用
put-metric-alarm
创建告警。
EC2
aws ec2 describe-instances
;使用
start-instances
/
stop-instances
/
terminate-instances
并指定
--instance-ids
最佳实践:优先使用IAM角色而非长期密钥;设置
AWS_REGION
/
AWS_PROFILE
环境变量;使用
--output json
--query
限制响应大小;执行破坏性操作前先通过
describe
确认资源。

Certifications & Training

认证与培训

Free: AWS Skill Builder — exam prep, Cloud Quest, Cloud Essentials. Cloud Practitioner (CLF-C02): Cloud concepts, security/compliance, technology/services, billing (~6 months exposure). Solutions Architect Associate: Next step; prep on Skill Builder.
Skill data: Map to S3, Lambda, CloudWatch, EC2, IAM; security best practices; no hardcoded credentials.
免费资源AWS Skill Builder —— 备考资料、Cloud Quest、Cloud Essentials。云从业者认证(CLF-C02):涵盖云概念、安全与合规、技术与服务、计费(建议有6个月相关经验)。解决方案架构师助理认证:进阶认证;可在Skill Builder上备考。
Skill相关数据:覆盖S3、Lambda、CloudWatch、EC2、IAM;包含安全最佳实践;禁止硬编码凭证。

Hooks & Workflows

钩子与工作流

Suggested hooks: Pre-deploy: validate credentials (
aws sts get-caller-identity
). Cost-tracking hook: optional CloudWatch/billing checks. No mandatory hook; use when devops is routed for AWS tasks.
Workflows: Use with devops (contextual:
aws_project
). Flow: detect AWS project → load aws-cloud-ops → run CLI via skill script. See
operations/incident-response
if debugging AWS resources.
推荐钩子:部署前:验证凭证(执行
aws sts get-caller-identity
)。成本追踪钩子:可选CloudWatch/账单检查。无强制钩子;处理AWS任务时路由至devops时使用。
工作流:与devops配合使用(上下文:
aws_project
)。流程:检测AWS项目 → 加载aws-cloud-ops → 通过Skill脚本运行CLI。如需调试AWS资源,请查看
operations/incident-response

Overview

概述

Provides 90%+ context savings vs raw AWS MCP server. Multi-service support with progressive disclosure by service category.
相比原生AWS MCP服务器,可节省90%以上的上下文信息。支持多服务,按服务类别逐步展示内容。

Requirements

要求

  • AWS CLI v2
  • Configured credentials (AWS_PROFILE or ~/.aws/credentials)
  • AWS_REGION environment variable
  • AWS CLI v2
  • 已配置凭证(AWS_PROFILE或~/.aws/credentials)
  • AWS_REGION环境变量

Tools (Progressive Disclosure)

工具(逐步展示)

CloudWatch Operations

CloudWatch操作

ToolDescriptionConfirmation
logs-groupsList log groupsNo
logs-tailTail log streamNo
logs-filterFilter log eventsNo
metrics-listList metricsNo
metrics-getGet metric dataNo
alarm-listList alarmsNo
alarm-createCreate alarmYes
工具描述是否需要确认
logs-groups列出日志组
logs-tail跟踪日志流
logs-filter过滤日志事件
metrics-list列出指标
metrics-get获取指标数据
alarm-list列出告警
alarm-create创建告警

S3 Operations

S3操作

ToolDescriptionConfirmation
s3-lsList buckets/objectsNo
s3-cpCopy objectsYes
s3-syncSync directoriesYes
s3-rmDelete objectsYes
工具描述是否需要确认
s3-ls列出存储桶/对象
s3-cp复制对象
s3-sync同步目录
s3-rm删除对象

Lambda Operations

Lambda操作

ToolDescriptionConfirmation
lambda-listList functionsNo
lambda-getGet function detailsNo
lambda-invokeInvoke functionYes
lambda-logsGet function logsNo
工具描述是否需要确认
lambda-list列出函数
lambda-get获取函数详情
lambda-invoke调用函数
lambda-logs获取函数日志

EC2 Operations

EC2操作

ToolDescriptionConfirmation
ec2-listList instancesNo
ec2-describeDescribe instanceNo
ec2-startStart instanceYes
ec2-stopStop instanceYes
sg-listList security groupsNo
工具描述是否需要确认
ec2-list列出实例
ec2-describe描述实例信息
ec2-start启动实例
ec2-stop停止实例
sg-list列出安全组

IAM Operations (Read-Only)

IAM操作(只读)

ToolDescriptionConfirmation
iam-usersList usersNo
iam-rolesList rolesNo
iam-policiesList policiesNo
工具描述是否需要确认
iam-users列出用户
iam-roles列出角色
iam-policies列出策略

Quick Reference

快速参考

bash
undefined
bash
undefined

List EC2 instances

列出EC2实例

aws ec2 describe-instances --output table
aws ec2 describe-instances --output table

Tail CloudWatch logs

跟踪CloudWatch日志

aws logs tail /aws/lambda/my-function --follow
aws logs tail /aws/lambda/my-function --follow

List S3 buckets

列出S3存储桶

aws s3 ls
aws s3 ls

Invoke Lambda

调用Lambda

aws lambda invoke --function-name my-func output.json
undefined
aws lambda invoke --function-name my-func output.json
undefined

Configuration

配置

  • AWS_PROFILE: Named profile to use
  • AWS_REGION: Target region (e.g., us-east-1)
  • AWS_DEFAULT_OUTPUT: Output format (json/table/text)
  • AWS_PROFILE:要使用的命名配置文件
  • AWS_REGION:目标区域(例如:us-east-1)
  • AWS_DEFAULT_OUTPUT:输出格式(json/table/text)

Security

安全

⚠️ Never hardcode credentials ⚠️ Use IAM roles when possible ⚠️ IAM write operations are blocked
⚠️ 禁止硬编码凭证 ⚠️ 尽可能使用IAM角色 ⚠️ IAM写入操作已被阻止

Agent Integration

Agent集成

  • devops (primary): Cloud operations
  • cloud-integrator (primary): Multi-cloud
  • incident-responder (secondary): Troubleshooting
  • devops(主要):云运维
  • cloud-integrator(主要):多云集成
  • incident-responder(次要):故障排查

Troubleshooting

故障排除

IssueSolution
Access deniedCheck IAM permissions
Region errorSet AWS_REGION
CredentialsRun aws configure
问题解决方案
访问被拒绝检查IAM权限
区域错误设置AWS_REGION环境变量
凭证问题执行aws configure

Memory Protocol (MANDATORY)

内存协议(必须遵守)

Before starting: Read
.claude/context/memory/learnings.md
After completing:
  • New pattern ->
    .claude/context/memory/learnings.md
  • Issue found ->
    .claude/context/memory/issues.md
  • Decision made ->
    .claude/context/memory/decisions.md
ASSUME INTERRUPTION: If it's not in memory, it didn't happen.
开始前: 阅读
.claude/context/memory/learnings.md
完成后:
  • 新模式 → 写入
    .claude/context/memory/learnings.md
  • 发现问题 → 写入
    .claude/context/memory/issues.md
  • 决策记录 → 写入
    .claude/context/memory/decisions.md
假设会被中断:未记录到内存中的操作视为未执行。