sre-aws
Skill4 starsChanged 23 days agoMITView on GitHub
Use when the system runs on AWS: Health, CloudWatch metrics and Logs Insights, EC2/EKS/RDS/ELB/ASG/ECS status, CloudTrail, quotas. Read-only profile via AWS CLI or MCP; writes need approval.
In this repository84 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/sre-safety-gates.mdcCursor rule
- sre-awsSkill
- sre-azureSkill
- sre-capacity-planningSkill
- sre-change-safetySkill
- sre-chaos-engineeringSkill
- sre-cloud-cost-reviewSkill
- sre-database-triageSkill
- sre-datadogSkill
- sre-dependency-mappingSkill
- sre-diagnosticsSkill
- sre-dr-backup-testSkill
- sre-dynatraceSkill
- sre-emudhra-ca-checkSkill
- sre-engineerSkill
- sre-expiry-auditSkill
- sre-gcpSkill
- sre-incident-commandSkill
- sre-incident-communicationSkill
- sre-k8s-safe-remediationSkill
- sre-k8s-triageSkill
- sre-k8s-upgrade-autopilotSkill
- sre-message-queue-triageSkill
- sre-migration-safetySkill
- sre-observability-cost-cutterSkill
- sre-observability-query-cookbookSkill
- sre-oncall-auditSkill
- sre-oncall-handoffSkill
- sre-pagerduty-opsgenieSkill
- sre-php2shell-checkSkill
- sre-postmortem-templatesSkill
- sre-production-readinessSkill
- sre-prometheus-grafanaSkill
- sre-remediation-actionsSkill
- sre-runbook-templatesSkill
- sre-safety-gatesSkill
- sre-security-incident-triageSkill
- sre-service-mesh-triageSkill
- sre-slo-alertingSkill
- sre-slo-burn-rate-rulesSkill
- sre-terraformSkill
- sre-toil-reviewSkill
- sre-azureSkill
- sre-capacity-planningSkill
- sre-change-safetySkill
- sre-chaos-engineeringSkill
- sre-cloud-cost-reviewSkill
- sre-database-triageSkill
- sre-datadogSkill
- sre-dependency-mappingSkill
- sre-diagnosticsSkill
- sre-dr-backup-testSkill
- sre-dynatraceSkill
- sre-emudhra-ca-checkSkill
- sre-engineerSkill
- sre-expiry-auditSkill
- sre-gcpSkill
- sre-incident-commandSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
- Very specific: line 22
Bound pagination: add --max-items <n> to list/describe calls.
- Very specific: line 84
Check replica lag first (read-only).
- Distinctive: line 118
If neither the AWS MCP server nor the AWS CLI is available, output the commands for the human and stop.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AWS
Safety gates (REQUIRED)
- Read-only diagnosis first.
- Propose each change with risk (low/med/high) and reversibility.
- Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
- Act only as approved, verify, and stop and escalate if anything gets worse.
Full rules: sre-safety-gates. Read-only MCP setup: sre-safety-gates/references/mcp.md.
Process skills: sre-engineer, sre-k8s-triage (EKS), sre-dr-backup-test, sre-capacity-planning, sre-cloud-cost-review, sre-security-incident-triage.
Rules
- Every command carries
--profile <profile> --region <region>(orAWS_PROFILE/AWS_REGIONset and confirmed). Nothing depends on local defaults. - Bound pagination: add
--max-items <n>to list/describe calls. - Writes needing approval: any
create-*,update-*,modify-*,delete-*,put-*,start-*/stop-*/reboot-*,terminate-*,restore-*,register-*/deregister-*,attach-*/detach-*,tag-*/untag-*,set-desired-capacity; alsologs start-query(cost) andeks update-kubeconfig(local write). - IAM:
ViewOnlyAccess(metadata only) plus the extras in references/readonly-iam-policy.json (ce:GetCostAndUsage,health:Describe*,logs:StartQuery/GetQueryResults/FilterLogEvents,sts:GetCallerIdentity) and its explicit Deny for secret/data reads (secretsmanager:GetSecretValue,ssm:GetParameter*,s3:GetObject,kms:Decrypt). Do not grantlogs:StartLiveTail(streams). AvoidReadOnlyAccess: it can read data. - Cost: CloudWatch metric API calls are billed per request; Logs Insights bills per GB scanned; Cost Explorer bills per request. Keep windows narrow.
Always first
aws sts get-caller-identity --profile <profile>
aws configure list --profile <profile> # shows region source; `aws configure get region` ignores AWS_REGION/--region
echo "${AWS_REGION:-$AWS_DEFAULT_REGION}"Health and status (read-only)
AWS Health API needs Business Support+, Enterprise, or Unified Operations (or legacy Business / Enterprise On-Ramp / Enterprise where those still apply); otherwise SubscriptionRequiredException. The active endpoint is us-east-1 (us-east-2 is passive, eventually consistent); on failover find the active Region with dig global.health.amazonaws.com. Org-wide: aws health describe-events-for-organization (needs organizational view enabled from the management or delegated-admin account).
aws health describe-events --profile <profile> --region us-east-1 --filter eventStatusCodes=open --max-items 50
aws ec2 describe-instance-status --profile <profile> --region <region> --include-all-instances --filters Name=instance-status.status,Values=impaired --max-items 100
aws autoscaling describe-auto-scaling-groups --profile <profile> --region <region> --auto-scaling-group-names <asg>
aws elbv2 describe-target-health --profile <profile> --region <region> --target-group-arn <arn>
aws rds describe-db-instances --profile <profile> --region <region> --db-instance-identifier <db> --query 'DBInstances[0].DBInstanceStatus'
aws eks describe-cluster --profile <profile> --region <region> --name <cluster> --query 'cluster.status'Kubeconfig (local write: edits ~/.kube/config and can switch your current context; use an alias, then confirm):
aws eks update-kubeconfig --profile <profile> --region <region> --name <cluster> --alias <cluster>-ro --kubeconfig ./kubeconfig-<cluster> # per-incident file
kubectl config current-contextCloudWatch (read-only; billed per request / per GB)
aws cloudwatch describe-alarms --profile <profile> --region <region> --state-value ALARM --max-items 100
aws cloudwatch get-metric-statistics --profile <profile> --region <region> --namespace AWS/ApplicationELB --metric-name HTTPCode_Target_5XX_Count \
--dimensions Name=LoadBalancer,Value=<app/name/id> --start-time <ISO8601> --end-time <ISO8601> --period 300 --statistics Sum
aws logs tail /aws/lambda/<fn> --profile <profile> --region <region> --since 30m --filter-pattern "?ERROR ?Exception" | head -200 # filtered and capped; never --follow unattended
# Logs Insights: one log group, narrow window (billed per GB scanned)
aws logs start-query --profile <profile> --region <region> --log-group-name <group> --start-time <epoch> --end-time <epoch> \
--query-string 'fields @timestamp, @message | filter @message like /ERROR/ | sort @timestamp desc | limit 50'
aws logs get-query-results --profile <profile> --region <region> --query-id <query-id>
aws logs stop-query --profile <profile> --region <region> --query-id <query-id> # stop a runaway queryCommon remediations (WRITE — approval required)
| Action | Command | Risk | Reversible |
| Scale ASG | aws autoscaling set-desired-capacity --profile <profile> --region <region> --auto-scaling-group-name <asg> --desired-capacity <n> | low | yes |
| Deregister bad target | aws elbv2 deregister-targets --profile <profile> --region <region> --target-group-arn <arn> --targets Id=<id> | low | yes |
| Reboot RDS with failover (Multi-AZ only; causes a brief outage) | aws rds reboot-db-instance --profile <profile> --region <region> --db-instance-identifier <db> --force-failover | high | no |
| Fail over an Aurora or RDS for PostgreSQL Multi-AZ DB cluster to a named replica (gated blocks below) | aws rds failover-db-cluster --profile <profile> --region <region> --db-cluster-identifier <cluster> --target-db-instance-identifier <replica-instance> | high | no |
| Fail over an RDS for MySQL Multi-AZ DB cluster (no target flag; gated block below) | aws rds failover-db-cluster --profile <profile> --region <region> --db-cluster-identifier <cluster> | high | no |
| Roll back ECS service | aws ecs update-service --profile <profile> --region <region> --cluster <c> --service <s> --task-definition <family:prev-rev> | med | yes |
Aurora or Multi-AZ DB cluster failover
Last resort, after sre-database-triage shows the writer itself is the problem. Capture evidence first with bash ../sre-database-triage/scripts/db-snapshot.sh <pg|mysql> <outdir>. The IC and the database owner approve. Writers drop their connections for a short time while the cluster endpoint moves (typically tens of seconds), so apps must reconnect.
Check replica lag first (read-only). Aurora replicas report AuroraReplicaLag in milliseconds; Multi-AZ DB cluster standbys report ReplicaLag in seconds. Run it for every replica or standby you might fail over to:
aws cloudwatch get-metric-statistics --profile <profile> --region <region> --namespace AWS/RDS --metric-name <AuroraReplicaLag|ReplicaLag> --dimensions Name=DBInstanceIdentifier,Value=<replica-instance> --start-time <ISO8601-15min-ago> --end-time <ISO8601-now> --period 60 --statistics MaximumAurora (MySQL or PostgreSQL) or an RDS for PostgreSQL Multi-AZ DB cluster: pick the target replica yourself, the one with the lowest lag, instead of letting RDS choose.
Gate: approval required.
aws rds failover-db-cluster --profile <profile> --region <region> --db-cluster-identifier <cluster> --target-db-instance-identifier <replica-instance>RDS for MySQL Multi-AZ DB cluster: --target-db-instance-identifier isn't supported, so RDS picks one of the two readable standbys. Check ReplicaLag on both standbys first, and fail over only when both are caught up.
Gate: approval required.
aws rds failover-db-cluster --profile <profile> --region <region> --db-cluster-identifier <cluster>Aurora Global Database is different: use aws rds switchover-global-cluster (planned, no data loss) or aws rds failover-global-cluster (Region outage, may lose data), not this command. Both are separate gated proposals.
Bundled scripts and references
AWS_PROFILE=<profile> AWS_REGION=<region> bash scripts/preflight.sh # identity, account, region; stop if wrong
AWS_PROFILE=<profile> AWS_REGION=<region> bash scripts/logs-insights-bounded.sh <log-group> 30 'fields @timestamp, @message | filter @message like /ERROR/' # <= 60 min, auto "| limit 100"
AWS_PROFILE=<profile> bash scripts/scan-unattached-ebs-eip.sh <region> # cost review input- references/readonly-iam-policy.json + references/readonly-iam-policy.md (ViewOnlyAccess baseline, explicit denies)
- references/cost-and-limits.md (per-request charges for Logs Insights, Cost Explorer, Live Tail)
- RDS restore drills: sre-dr-backup-test/references/aws-rds.md
If neither the AWS MCP server nor the AWS CLI is available, output the commands for the human and stop.
Output
- Profile, account and region confirmed; findings with commands used; proposed actions with risk/reversibility
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

