复制安装命令
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
Supercharge Claude Code with AWS cloud engineering skills across 18 core AWS services.
用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。
复制前请先查看来源、License 和安全提示。
来源文件:README.md
Supercharge Claude Code with AWS cloud engineering skills across 18 core AWS services.
Developing AWS solutions is complex spanning IAM, compute, storage, security, serverless, networking, and more.
AWS Agent Skills equips Claude Code (and Codex) with deep expertise across 18 AWS domains, enabling automated cloud engineering support from IaC templates to debugging guidance and security best practices.
Automatically checks AWS documentation for updates on a weekly basis to ensure skills stay current with AWS service changes.
AWS MCP is great for live docs and API calls, but AWS Agent Skills is designed for reasoning first. It gives AI Agents a curated, LLM-optimized AWS knowledge base with real-world patterns, edge cases, and best practices, without streaming large docs or schemas. Because the skills are local and pre compressed, it is far more token efficient, keeps the context window small and predictable, and avoids MCP infrastructure, latency, and expanded credential exposure.
# Add the marketplace
/plugin marketplace add itsmostafa/aws-agent-skills
# Install the plugin
/plugin install aws-agent-skills
/plugin install https://github.com/itsmostafa/aws-agent-skills
/plugin install ./path/to/aws-agent-skills
$skill-installer install https://github.com/itsmostafa/aws-agent-skills/<skill-name>
For example, to install the rlhf skill:
$skill-installer install https://github.com/itsmostafa/aws-agent-skills/rlhf
| Skill | Description |
|---|---|
| iam | Identity and Access Management - users, roles, policies, permissions |
| lambda | Serverless functions - deployment, triggers, debugging |
| dynamodb | NoSQL database - table design, queries, indexes |
| s3 | Object storage - buckets, objects, security, lifecycle |
| api-gateway | REST and HTTP APIs - integrations, authorization |
| ec2 | Virtual machines - instances, AMIs, networking |
| ecs | Container orchestration - clusters, services, tasks |
| eks | Kubernetes - clusters, node groups, IRSA |
| cloudformation | Infrastructure as Code - templates, stacks, drift |
| cloudwatch | Monitoring - logs, metrics, alarms, dashboards |
| rds | Relational databases - instances, backups, replication |
| sqs | Message queues - standard, FIFO, dead-letter queues |
| sns | Notifications - topics, subscriptions, filtering |
| cognito | User authentication - user pools, identity pools, OAuth |
| step-functions | Workflow orchestration - state machines, error handling |
| secrets-manager | Secret storage - rotation, versioning, RDS integration |
| eventbridge | Event bus - rules, patterns, cross-account events |
| bedrock | Foundation models - inference, RAG, custom models |
Ask Claude to help with IAM:
Each skill contains:
SKILL.md - Core concepts, patterns, CLI reference, best practices, troubleshootingSkills include metadata showing when content was last updated, so you always know how current the information is.
---
name: service-name
description: Service description. Use when <trigger phrases>.
---
# AWS Service Name
## Overview
## Core Concepts
## Common Patterns
## CLI Reference
## Best Practices
## Troubleshooting
## References
MIT License - see LICENSE for details.
name: cloudwatch
description: AWS CloudWatch monitoring for logs, metrics, alarms, and dashboards. Use when setting up monitoring, creating alarms, querying logs with Insights, configuring metric filters, building dashboards, or troubleshooting application issues.
last_updated: "2026-01-07"
doc_source: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/Amazon CloudWatch provides monitoring and observability for AWS resources and applications. It collects metrics, logs, and events, enabling you to monitor, troubleshoot, and optimize your AWS environment.
Time-ordered data points published to CloudWatch. Key components:
AWS/Lambda)Invocations)FunctionName=MyFunc)Log data from AWS services and applications:
Automated actions based on metric thresholds:
AWS CLI:
# CPU utilization alarm for EC2
aws cloudwatch put-metric-alarm \
--alarm-name "HighCPU-i-1234567890abcdef0" \
--metric-name CPUUtilization \
--namespace AWS/EC2 \
--statistic Average \
--period 300 \
--threshold 80 \
--comparison-operator GreaterThanThreshold \
--evaluation-periods 2 \
--dimensions Name=InstanceId,Value=i-1234567890abcdef0 \
--alarm-actions arn:aws:sns:us-east-1:123456789012:alerts \
--ok-actions arn:aws:sns:us-east-1:123456789012:alerts
boto3:
import boto3
cloudwatch = boto3.client('cloudwatch')
cloudwatch.put_metric_alarm(
AlarmName='HighCPU-i-1234567890abcdef0',
MetricName='CPUUtilization',
Namespace='AWS/EC2',
Statistic='Average',
Period=300,
Threshold=80.0,
ComparisonOperator='GreaterThanThreshold',
EvaluationPeriods=2,
Dimensions=[
{'Name': 'InstanceId', 'Value': 'i-1234567890abcdef0'}
],
AlarmActions=['arn:aws:sns:us-east-1:123456789012:alerts'],
OKActions=['arn:aws:sns:us-east-1:123456789012:alerts']
)
aws cloudwatch put-metric-alarm \
--alarm-name "LambdaErrorRate-MyFunction" \
--metrics '[
{
"Id": "errors",
"MetricStat": {
"Metric": {
"Namespace": "AWS/Lambda",
"MetricName": "Errors",
"Dimensions": [{"Name": "FunctionName", "Value": "MyFunction"}]
},
"Period": 60,
"Stat": "Sum"
},
"ReturnData": false
},
{
"Id": "invocations",
"MetricStat": {
"Metric": {
"Namespace": "AWS/Lambda",
"MetricName": "Invocations",
"Dimensions": [{"Name": "FunctionName", "Value": "MyFunction"}]
},
"Period": 60,
"Stat": "Sum"
},
"ReturnData": false
},
{
"Id": "errorRate",
"Expression": "errors/invocations*100",
"Label": "Error Rate",
"ReturnData": true
}
]' \
--threshold 5 \
--comparison-operator GreaterThanThreshold \
--evaluation-periods 3 \
--alarm-actions arn:aws:sns:us-east-1:123456789012:alerts
# Find errors in Lambda logs
aws logs start-query \
--log-group-name /aws/lambda/MyFunction \
--start-time $(date -d '1 hour ago' +%s) \
--end-time $(date +%s) \
--query-string '
fields @timestamp, @message
| filter @message like /ERROR/
| sort @timestamp desc
| limit 50
'
# Get query results
aws logs get-query-results --query-id <query-id>
boto3:
import boto3
import time
logs = boto3.client('logs')
# Start query
response = logs.start_query(
logGroupName='/aws/lambda/MyFunction',
startTime=int(time.time()) - 3600,
endTime=int(time.time()),
queryString='''
fields @timestamp, @message
| filter @message like /ERROR/
| sort @timestamp desc
| limit 50
'''
)
query_id = response['queryId']
# Wait for results
while True:
result = logs.get_query_results(queryId=query_id)
if result['status'] == 'Complete':
break
time.sleep(1)
for row in result['results']:
print(row)
Extract metrics from log patterns:
# Create metric filter for error count
aws logs put-metric-filter \
--log-group-name /aws/lambda/MyFunction \
--filter-name ErrorCount \
--filter-pattern "ERROR" \
--metric-transformations \
metricName=ErrorCount,metricNamespace=MyApp,metricValue=1,defaultValue=0
import boto3
cloudwatch = boto3.client('cloudwatch')
cloudwatch.put_metric_data(
Namespace='MyApp',
MetricData=[
{
'MetricName': 'OrdersProcessed',
'Value': 1,
'Unit': 'Count',
'Dimensions': [
{'Name': 'Environment', 'Value': 'Production'},
{'Name': 'OrderType', 'Value': 'Standard'}
]
}
]
)
cat > dashboard.json << 'EOF'
{
"widgets": [
{
"type": "metric",
"x": 0, "y": 0, "width": 12, "height": 6,
"properties": {
"title": "Lambda Invocations",
"metrics": [
["AWS/Lambda", "Invocations", "FunctionName", "MyFunction"]
],
"period": 60,
"stat": "Sum",
"region": "us-east-1"
}
},
{
"type": "log",
"x": 12, "y": 0, "width": 12, "height": 6,
"properties": {
"title": "Recent Errors",
"query": "SOURCE '/aws/lambda/MyFunction' | filter @message like /ERROR/ | limit 20",
"region": "us-east-1"
}
}
]
}
EOF
aws cloudwatch put-dashboard \
--dashboard-name MyAppDashboard \
--dashboard-body file://dashboard.json
| Command | Description |
|---|---|
aws cloudwatch put-metric-data | Publish custom metrics |
aws cloudwatch get-metric-data | Retrieve metric values |
aws cloudwatch get-metric-statistics | Get aggregated statistics |
aws cloudwatch list-metrics | List available metrics |
| Command | Description |
|---|---|
aws cloudwatch put-metric-alarm | Create or update alarm |
aws cloudwatch describe-alarms | List alarms |
aws cloudwatch set-alarm-state | Manually set alarm state |
aws cloudwatch delete-alarms | Delete alarms |
| Command | Description |
|---|---|
aws logs create-log-group | Create log group |
aws logs put-log-events | Write log events |
aws logs filter-log-events | Search log events |
aws logs start-query | Start Insights query |
aws logs put-metric-filter | Create metric filter |
aws logs put-retention-policy | Set log retention |
Causes:
Debug:
# List metrics for a namespace
aws cloudwatch list-metrics \
--namespace AWS/Lambda \
--dimensions Name=FunctionName,Value=MyFunction
Causes:
Debug:
# Check if metric has data
aws cloudwatch get-metric-statistics \
--namespace AWS/Lambda \
--metric-name Invocations \
--dimensions Name=FunctionName,Value=MyFunction \
--start-time $(date -d '1 hour ago' -u +%Y-%m-%dT%H:%M:%SZ) \
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
--period 60 \
--statistics Sum
Causes:
Debug:
# Check log streams
aws logs describe-log-streams \
--log-group-name /aws/lambda/MyFunction \
--order-by LastEventTime \
--descending \
--limit 5
Check usage:
# Get PutLogEvents usage
aws cloudwatch get-metric-statistics \
--namespace AWS/Logs \
--metric-name IncomingBytes \
--dimensions Name=LogGroupName,Value=/aws/lambda/MyFunction \
--start-time $(date -d '7 days ago' -u +%Y-%m-%dT%H:%M:%SZ) \
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
--period 86400 \
--statistics Sum
评论 (0)
暂无评论,成为第一个评论者吧!