AWS Resource Health Diagnose

AWS Resource Health Diagnose

Guides the AI to assess an AWS resource's health, diagnose problems from CloudWatch logs and metrics, and write a remediation plan.

Skill files1 file
SKILL.md180 lines
1
---
2
name: aws-resource-health-diagnose
3
description: 'Analyze AWS resource health, diagnose issues from CloudWatch logs and metrics, and create a remediation plan for identified problems.'
4
---
5
6
# AWS Resource Health & Issue Diagnosis
7
8
This workflow analyzes a specific AWS resource to assess its health status, diagnose potential issues using CloudWatch logs and metrics, and develop a comprehensive remediation plan for any problems discovered.
9
10
## Prerequisites
11
- AWS CLI configured and authenticated
12
- Target AWS resource identified (name, type, and optionally region/account)
13
- CloudWatch logging and metrics enabled on the target resource
14
15
## Workflow Steps
16
17
### Step 1: Get AWS Diagnostic Best Practices
18
Fetch `https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/` for monitoring and troubleshooting guidance to inform the diagnostic approach.
19
20
### Step 2: Resource Discovery & Identification
21
Locate the target resource using the appropriate AWS CLI command for its type:
22
23
```bash
24
# EC2
25
aws ec2 describe-instances --filters "Name=tag:Name,Values=<name>"
26
# Lambda
27
aws lambda get-function --function-name <name>
28
# RDS
29
aws rds describe-db-instances --db-instance-identifier <name>
30
# ECS
31
aws ecs describe-services --cluster <cluster> --services <name>
32
# ALB
33
aws elbv2 describe-load-balancers --names <name>
34
# DynamoDB
35
aws dynamodb describe-table --table-name <name>
36
# SQS
37
aws sqs get-queue-attributes --queue-url <url> --attribute-names All
38
# API Gateway
39
aws apigatewayv2 get-apis
40
```
41
42
If multiple matches are found, prompt the user to specify region/account.
43
44
### Step 3: Health Status Assessment
45
Run service-specific health checks:
46
47
```bash
48
# EC2
49
aws ec2 describe-instance-status --instance-ids <id>
50
51
# RDS
52
aws rds describe-db-instances --db-instance-identifier <name> \
53
--query 'DBInstances[0].DBInstanceStatus'
54
55
# Lambda - error rate over 24h
56
aws cloudwatch get-metric-statistics --namespace AWS/Lambda \
57
--metric-name Errors --dimensions Name=FunctionName,Value=<name> \
58
--start-time $(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ) \
59
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
60
--period 3600 --statistics Sum
61
62
# ECS
63
aws ecs describe-services --cluster <cluster> --services <name> \
64
--query 'services[0].[status,runningCount,desiredCount,pendingCount]'
65
```
66
67
Key health indicators by service type:
68
- **Lambda**: Error rate, throttle rate, duration P99, concurrent executions
69
- **RDS**: CPU utilization, FreeStorageSpace, DatabaseConnections, ReadLatency/WriteLatency
70
- **ECS**: Running vs desired task count, task stop reason
71
- **ALB**: TargetResponseTime, HTTPCode_ELB_5XX_Count, UnHealthyHostCount
72
- **SQS**: ApproximateNumberOfMessagesNotVisible, ApproximateAgeOfOldestMessage
73
- **DynamoDB**: ConsumedReadCapacityUnits, ThrottledRequests, SuccessfulRequestLatency
74
75
### Step 4: Log & Metrics Analysis
76
Find log groups and run CloudWatch Logs Insights queries:
77
78
```bash
79
# Find log groups
80
aws logs describe-log-groups --log-group-name-prefix /aws/<service>/<name>
81
82
# Start a query (last 24h errors)
83
aws logs start-query \
84
--log-group-name /aws/lambda/<name> \
85
--start-time $(date -u -d '24 hours ago' +%s) \
86
--end-time $(date -u +%s) \
87
--query-string 'filter @message like /ERROR/ | stats count(*) as errorCount by bin(1h)'
88
89
# Get results
90
aws logs get-query-results --query-id <id>
91
92
# Lambda cold starts
93
aws logs start-query \
94
--log-group-name /aws/lambda/<name> \
95
--start-time $(date -u -d '24 hours ago' +%s) \
96
--end-time $(date -u +%s) \
97
--query-string 'filter @type = "REPORT" | filter @initDuration > 0 | stats count() as coldStarts by bin(1h)'
98
99
# RDS Performance Insights (if enabled)
100
aws pi get-resource-metrics \
101
--service-type RDS --identifier db:<identifier> \
102
--metric-queries '[{"Metric":"db.load.avg"}]' \
103
--start-time $(date -u -d '24 hours ago' +%Y-%m-%dT%H:%M:%SZ) \
104
--end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
105
--period-in-seconds 3600
106
```
107
108
Identify: recurring error patterns, correlation with deployments (CloudTrail), performance trends, dependency failures.
109
110
### Step 5: Issue Classification & Root Cause Analysis
111
**Severity**:
112
- **Critical**: Service unavailable, data loss, security incidents
113
- **High**: Performance degradation, error rates >5%, intermittent failures
114
- **Medium**: Warnings, suboptimal configuration, minor performance issues
115
- **Low**: Informational alerts, optimization opportunities
116
117
**Root Cause Categories**:
118
- Configuration Issues: wrong settings, missing env vars, IAM permission denials
119
- Resource Constraints: CPU/memory/disk limits, Lambda throttling, RDS connection exhaustion
120
- Network Issues: security group rules, VPC routing, DNS, NACLs
121
- Application Issues: code bugs, memory leaks, unhandled exceptions, slow queries
122
- Dependency Issues: downstream timeouts, SQS/SNS failures, external API limits
123
- Security Issues: KMS key issues, certificate expiration
124
125
### Step 6: Generate Remediation Plan
126
127
**Immediate Actions** (Critical):
128
```bash
129
# Lambda throttling — increase reserved concurrency
130
aws lambda put-reserved-concurrency \
131
--function-name <name> --reserved-concurrent-executions 100
132
133
# RDS connection exhaustion — reboot to reset connections
134
aws rds reboot-db-instance --db-instance-identifier <name>
135
```
136
137
**Short-term Fixes** (High/Medium): Configuration adjustments, right-sizing, CloudWatch alarm improvements, IAM corrections.
138
139
**Long-term Improvements**: Architectural changes for resilience, preventive monitoring, enable AWS Health Dashboard notifications via EventBridge.
140
141
### Step 7: Report & User Confirmation
142
143
Present findings:
144
```
145
🏥 AWS Resource Health Assessment
146
147
📊 Resource Overview:
148
• Resource: [Name] ([Type])
149
• Status: [Healthy/Warning/Critical]
150
• Region: [Region] | Account: [Account ID]
151
152
🚨 Issues Identified:
153
• Critical: X | High: Y | Medium: Z | Low: N
154
155
🔍 Top Issues:
156
1. [Issue]: [Description] — Impact: [High/Medium/Low]
157
2. [Issue]: [Description] — Impact: [High/Medium/Low]
158
159
🛠️ Remediation: X immediate, Y short-term, Z long-term actions
160
161
❓ Proceed with detailed remediation plan? (y/n)
162
```
163
164
Then generate a full markdown report covering: health metrics, issues with root cause analysis, phased remediation steps with AWS CLI commands, CloudWatch alarm recommendations, and validation checklist.
165
166
## Error Handling
167
- **Resource Not Found**: Ask user to clarify name/region
168
- **Authentication Issues**: Guide through `aws configure`
169
- **Insufficient Permissions**: List required IAM actions (`logs:*`, `cloudwatch:*`, `pi:*`)
170
- **No Logs Available**: Suggest enabling CloudWatch logging for the resource type
171
- **Query Timeouts**: Use shorter time windows
172
173
## Success Criteria
174
- ✅ Resource health accurately assessed across all key metrics
175
- ✅ All significant issues identified and classified by severity
176
- ✅ Root cause analysis completed for major problems
177
- ✅ Actionable remediation plan with AWS CLI commands
178
- ✅ CloudWatch monitoring recommendations included
179
- ✅ Implementation steps include validation and rollback procedures
180

© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com

@OpenSourceBuffGuy

I find openly licensed prompts and post them here.

0 followers · 6,373 prompts

More by @OpenSourceBuffGuy

See all
Website Clone Architect prompt image

Website Clone Architect

Reverse-engineers a website section by section, writes component specs, and hands them to parallel builder agents in git worktrees to rebuild it.

agent-skill, orchestrator, parallel-agents, multi-agent, plan-then-execute, web-development, frontend, codebase-analysis, scaffolding, css, html, nextjs, typescript, git, mcp, claude-code, for-developers, for-designers, long-form, advanced, technical-spec, task-decomposition, structured-output, design-systems, ui-ux, tool-use, checklist, report, vibe-coding

Italian Terrace Cafe Candid Portrait prompt image

Italian Terrace Cafe Candid Portrait

Generates a photorealistic candid shot of a woman in a white corset dress laughing at a sunny hotel terrace cafe, written as detailed JSON.

image-prompt, json-prompt, structured-output, photorealistic, portrait, woman, candid, fashion, cottagecore, natural-light, golden-hour, bokeh, summer, travel, cityscape, mountains, medium-shot, vibrant-colors, for-photographers, nano-banana, fashion-shoot, luxury

Night Street Photo With Leashed Cat prompt image

Night Street Photo With Leashed Cat

Generates a flash-lit night street photo of a blonde woman in a retro track jacket walking a hissing tabby cat on a leash.

image-prompt, json-prompt, nano-banana, structured-output, portrait, woman, animals, pet-portrait, night-scene, street-photography, candid, editorial, fashion, dramatic-lighting, photorealistic, vertical-format, medium-shot, graffiti, for-photographers, for-content-creators

1 view

Reviews

Loading reviews…

Discussion

Loading comments…