compute-optimizer-findings-auditor
Audits AWS Compute Optimizer findings for EC2, EBS, Lambda, Auto Scaling Group, and ECS resources — classifies overprovisioned (underutilized) waste, underprovisioned (performance-risk) findings, and low-confidence recommendations (inferred memory, high performanceRisk, stale data) into a deterministic verdict with per-finding risk and CLI remediation. Emits UNDERUTILIZED | NOT_OPTIMIZED | OK per resource. Use when reviewing Compute Optimizer recommendations, triaging right-sizing findings, validating finding confidence before acting, or auditing cost-optimization posture.
- License 许可
- Apache-2.0
- 最近更新
- 2026-09-24
- Stars
- ★ 4
- Forks
- 0
01 前言 Front Matter
- name
- compute-optimizer-findings-auditor
- license
- Apache-2.0
- metadata
- { "tags": "compute, cost-optimization, right-sizing, compute-optimizer, ec2, ebs, lambda, audit", "phase": "2", "author": "Jacky Chan — AWS Community Builder", "domain": "aws-cloudops", "family": "Compute", "version": "0.1.0", "keywords": "Compute Optimizer, right-sizing, overprovisioned, underprovisioned, underutilized, EC2 recommendations, EBS recommendations, Lambda recommendations, Auto Scaling Group, ECS Fargate, performanceRisk, savingsOpportunity, finding confidence, inferred memory, CloudWatch Agent, cost optimization, resource utilization, gp3 migration, Lambda memory, finding reasons", "complexity": "medium", "entry_point": "false", "when_to_use": "Reviewing Compute Optimizer findings for EC2, EBS, Lambda, or ASG resources, triaging right-sizing recommendations, validating finding confidence before approving a right-size action, auditing cost- optimization posture, or checking whether a finding is actionable or low-confidence noise.", "requires_llm": "true", "verdict_shape": "UNDERUTILIZED | NOT_OPTIMIZED | OK", "invocation_schema": "Input: either (a) a Compute Optimizer finding/recommendation document (EC2, EBS, Lambda, ASG) with finding, findingReasons, utilizationMetrics, recommendationOptions, and metadata, OR (b) a resource ARN for live-account audit. Output: deterministic RESOURCE/VERDICT/REASON/FINDINGS/REMEDIATION block per resource, where VERDICT ∈ {UNDERUTILIZED, NOT_OPTIMIZED, OK}.", "supports_pipeline": "true", "activation_triggers": "audit compute optimizer findings, check EC2 right-sizing recommendations, is this compute optimizer finding reliable, review overprovisioned resources, compute optimizer low confidence, Lambda memory recommendations, EBS volume recommendations, performanceRisk too high, compute optimizer stale findings, right-size EC2 instances" }
- description
- Audits AWS Compute Optimizer findings for EC2, EBS, Lambda, Auto Scaling Group, and ECS resources — classifies overprovisioned (underutilized) waste, underprovisioned (performance-risk) findings, and low-confidence recommendations (inferred memory, high performanceRisk, stale data) into a deterministic verdict with per-finding risk and CLI remediation. Emits UNDERUTILIZED | NOT_OPTIMIZED | OK per resource. Use when reviewing Compute Optimizer recommendations, triaging right-sizing findings, validating finding confidence before acting, or auditing cost-optimization posture.
- compatibility
- Agent runtime that reads SKILL.md (Claude Code, Cursor, Windsurf, Codex, Gemini). No AWS CLI required for offline finding-document classification. Live-account audits use aws compute-optimizer get-ec2-instance-recommendations, get-ebs-volume-recommendations, get-lambda-function-recommendations, and get-enrollment-status (AWS CLI v2, SSO or key-based credentials).
02 资源文件 21
- 参考文档eval/test-cases.yaml8.9 KB
- 参考文档evals/baselines/ebs-volume-optimized.md273 B
- 参考文档evals/baselines/ec2-optimized-clean.md285 B
- 参考文档evals/baselines/ec2-overprovisioned-high-confidence.md735 B
- 参考文档evals/baselines/ec2-overprovisioned-low-confidence-inferred-memory.md598 B
- 参考文档evals/baselines/ec2-underprovisioned-cpu-memory.md484 B
- 参考文档evals/baselines/lambda-overprovisioned-memory.md425 B
- 参考文档evals/eval_config.yaml2.1 KB
- 参考文档evals/evals.json5.0 KB
- 参考文档evals/prompts/ebs-volume-optimized.md805 B
- 参考文档evals/prompts/ec2-optimized-clean.md672 B
- 参考文档evals/prompts/ec2-overprovisioned-high-confidence.md1.0 KB
- 参考文档evals/prompts/ec2-overprovisioned-low-confidence-inferred-memory.md848 B
- 参考文档evals/prompts/ec2-underprovisioned-cpu-memory.md882 B
- 参考文档evals/prompts/lambda-overprovisioned-memory.md813 B
- 参考文档examples/end-to-end.md6.8 KB
- 参考文档references/advanced-patterns.md8.5 KB
- 参考文档references/diagnostic-commands.md2.8 KB
- 参考文档references/error-handling.md2.4 KB
- 参考文档references/worked-examples.md1.3 KB
- 参考文档skill.usf.yaml4.0 KB
03 SKILL.md 正文
Compute Optimizer Findings Auditor
Mindset
One-line takeaway: the verdict depends on BOTH the finding field AND
finding confidence. An Overprovisioned finding with inferred memory (no
CloudWatch Agent) is NOT actionable — it is NOT_OPTIMIZED, not
UNDERUTILIZED. Confidence gates the verdict.
AWS Compute Optimizer analyses 30+ days of CloudWatch utilization metrics and
emits findings: Optimized, Overprovisioned, or Underprovisioned. But the
finding text alone does not tell you whether the recommendation is safe to act
on. Three factors override the finding:
- Memory metrics are inferred without the CloudWatch Agent (CWAgent).
Without it, Compute Optimizer cannot see actual memory usage — it infers
memory from the instance type's published specs. An
Overprovisionedfinding based on CPU-only data may be wrong if the instance is memory-bound. - performanceRisk (1-5) on the recommended option warns whether the suggested instance type can handle the workload. Risk 4-5 means the recommendation is speculative — do NOT act without load testing.
- Insufficient data (new resources, stopped instances, zero-invocation Lambda functions) produces unreliable or absent findings.
Quick reference — verdict thresholds
| Condition | Verdict | Rule |
|---|---|---|
finding: Overprovisioned + HIGH confidence + savings > $0 |
UNDERUTILIZED | Step 4a |
finding: Overprovisioned + LOW confidence (inferred memory / performanceRisk ≥ 4) |
NOT_OPTIMIZED | Step 3 |
finding: Underprovisioned |
NOT_OPTIMIZED | Step 4b |
finding: Optimized + metrics present |
OK | Step 4c |
| No finding / insufficient data / enrollment inactive | NOT_OPTIMIZED | Step 1 |
finding: Optimized + lastRefresh > 30 days stale |
NOT_OPTIMIZED | Step 2 |
See the ordered steps below for edge cases. Deep Compute Optimizer internals (analysis windows, metric sources, recommendation generation) are in the Deep reference section.
Pre-flight: enrollment and data gate (run before classification)
Before evaluating findings, verify that Compute Optimizer is producing real data. Several conditions short-circuit the audit — misclassifying them produces false confidence.
Moved verbatim to references/diagnostic-commands.md - load on demand (see References below).
| Condition | Effect on audit |
|---|---|
Enrollment Inactive |
No findings possible. Output NOT_OPTIMIZED: "enrollment inactive — opt in via AWS Console or CLI." |
lastRefreshTimestamp > 30 days old |
Stale finding — workload may have changed. Downgrade to NOT_OPTIMIZED. |
utilizationMetrics empty or < 2 entries |
Insufficient data for reliable classification. NOT_OPTIMIZED. |
| EC2 Memory metric absent (no CWAgent) | Memory inferred — finding confidence is LOW. Gate per Step 3. |
| Lambda invocations = 0 during analysis period | No utilization signal. NOT_OPTIMIZED: "insufficient invocation data." |
findingReasons empty on a non-Optimized finding |
Malformed finding — missing root cause. NOT_OPTIMIZED with note. |
Process — Classification logic (apply in order, aggregate worst)
Step 0: Validate input
If the finding document is missing required fields (finding, or finding
is not one of Optimized/Overprovisioned/Underprovisioned), output:
RESOURCE: <arn>
VERDICT: ERROR
REASON: Finding document is missing the 'finding' field or contains an invalid value — cannot classify.
REMEDIATION: Re-fetch with the appropriate aws compute-optimizer get-*-recommendations command.
Step 1: Enrollment and data sufficiency check
If any of these conditions are true, classify as NOT_OPTIMIZED and skip remaining steps:
- Enrollment status is
Inactive(no data at all). utilizationMetricsis empty or has fewer than 2 entries (EC2/EBS) — insufficient data to determine optimization state.- Lambda function with 0 invocations during the analysis period — no utilization signal exists.
findingReasonsis empty on a non-Optimizedfinding — root cause cannot be determined.
These all mean the resource's optimization state cannot be confidently determined. The finding (if present) is noise, not signal.
Step 2: Stale finding check
If lastRefreshTimestamp is more than 30 days old, the finding reflects a
workload that may have since changed. Classify as NOT_OPTIMIZED
regardless of finding value, with reason: "stale finding — last refresh >
30 days ago; re-run recommendation before acting."
This is critical because Compute Optimizer does NOT retroactively update findings when a workload changes — it only refreshes on the next analysis cycle (approximately every 24 hours). A finding from 45 days ago may describe a workload that was terminated and replaced.
Step 3: Confidence evaluation (gates the verdict)
Evaluate whether the finding is HIGH or LOW confidence. Confidence determines whether an Overprovisioned finding becomes UNDERUTILIZED (actionable cost waste) or NOT_OPTIMIZED (unreliable — do not act).
A finding is LOW confidence if ANY of these are true:
-
EC2 Memory metric is absent from
utilizationMetrics. Without the CloudWatch Agent (CWAgent), Compute Optimizer cannot see actual memory usage. It infers memory from the instance type's published specifications. AnOverprovisionedfinding may be wrong if the instance is memory-constrained — the CPU is idle but memory is at 95%. This is the single most common false-positive source in Compute Optimizer. -
performanceRisk ≥ 4 on the recommended instance type. The performanceRisk score (1-5) estimates the likelihood that the recommended instance type cannot handle the workload. Risk 1 is safe; Risk 4-5 means the recommendation is speculative and should not be acted on without load testing. The first (cheapest) recommendation option often carries the highest risk.
-
EC2: fewer than 3 utilization metrics. A reliable EC2 finding needs at least CPU, Memory, and one more dimension (Network or Disk). CPU-only findings are weak signal — the instance may be network-bound or I/O-bound.
-
EBS: only one of {IOPS, Throughput} present. Volume type/size recommendations need both read/write IOPS and throughput data. A recommendation based on only one dimension may miss a bottleneck in the other.
If the finding is LOW confidence, classify as NOT_OPTIMIZED — the finding cannot be trusted enough to recommend a right-size action. The remediation is to improve data quality (install CWAgent, wait for more data) before re-evaluating.
If the finding is HIGH confidence, proceed to Step 4.
Step 4: Finding field classification
Apply based on the finding value:
4a: Overprovisioned + HIGH confidence → UNDERUTILIZED
The resource has excess capacity — it is underutilized and wasting spend.
Extract the savingsOpportunity.estimatedMonthlySavings to quantify the
waste. The recommendation options are actionable (performanceRisk is
acceptable).
Risk levels for UNDERUTILIZED:
- HIGH risk if estimatedMonthlySavings > $100/month OR CPU utilization < 10%
- MEDIUM risk if estimatedMonthlySavings $10-$100/month
- LOW risk if estimatedMonthlySavings < $10/month (pennies — note but do not prioritize)
4b: Underprovisioned → NOT_OPTIMIZED
The resource is too small for its workload — performance degradation is likely. This is NOT "underutilized" — the resource is overworked, not wasting money. The remediation is to UP-size, not down-size.
Risk levels for NOT_OPTIMIZED (Underprovisioned):
- HIGH risk if CPU > 90% AND findingReasons include
CPUUnderprovisioned— active performance degradation. - MEDIUM risk if any single resource dimension is underprovisioned (Memory, Network, etc.).
4c: Optimized → OK
The resource is correctly provisioned. No action needed. Verify that the finding has sufficient utilization metrics to be trustworthy (Step 3 confidence check should have passed).
Step 5: Aggregation — worst finding wins
When auditing multiple resources in a single pass, the account-level verdict is the worst verdict across all resources, where NOT_OPTIMIZED is worse than UNDERUTILIZED and UNDERUTILIZED is worse than OK:
account_verdict = max(all_resource_verdicts)
Order: NOT_OPTIMIZED > UNDERUTILIZED > OK
This ordering reflects that a performance risk (Underprovisioned) is more urgent than wasted spend (Overprovisioned) — an underprovisioned resource may be causing customer-visible latency, while an overprovisioned resource is only losing money.
Output format (per resource)
RESOURCE: <arn or resource-id>
VERDICT: UNDERUTILIZED | NOT_OPTIMIZED | OK
REASON: <1-2 sentences citing the finding, confidence level, and key metric>
RISK: HIGH | MEDIUM | LOW
FINDINGS:
- [<severity>] <finding description with rule citation>
REMEDIATION: <specific action per finding, or "None required" if OK>
Worked example — EC2 Overprovisioned, high confidence
RESOURCE: arn:aws:ec2:us-east-1:111111111111:instance/i-0abc123
VERDICT: UNDERUTILIZED
REASON: Finding is Overprovisioned with HIGH confidence — CPU 8%, Memory 15%
(both measured by CloudWatch Agent), performanceRisk 1 on recommendation.
Savings opportunity: $150/month.
RISK: HIGH
FINDINGS:
- [HIGH] Overprovisioned: m5.2xlarge with CPU max 8% and Memory max 15% —
both metrics measured by CWAgent. Recommended t3.large saves 75% (Step 4a).
- [OK] performanceRisk 1 on recommended option — safe to right-size.
REMEDIATION:
1. Stop the instance: aws ec2 stop-instances --instance-ids i-0abc123.
2. Change instance type: aws ec2 modify-instance-attribute --instance-id
i-0abc123 --instance-type "{\"Value\": \"t3.large\"}".
3. Start the instance: aws ec2 start-instances --instance-ids i-0abc123.
4. Monitor CPU and Memory for 7 days post-change to confirm the
workload runs within the new instance's capacity.
Worked example — EC2 Overprovisioned, LOW confidence (inferred memory)
Moved verbatim to references/worked-examples.md - load on demand (see References below).
Expert edge cases — non-obvious Compute Optimizer behaviors
Moved verbatim to references/advanced-patterns.md - load on demand (see References below).
Anti-Patterns — NEVER
-
NEVER classify an
Overprovisionedfinding as UNDERUTILIZED when the EC2 Memory metric is absent fromutilizationMetrics. Without the CloudWatch Agent, memory usage is inferred — the finding is LOW confidence and should be NOT_OPTIMIZED. This is the most common false positive. -
NEVER act on a recommendation with
performanceRisk≥ 4 without load testing. The risk score means Compute Optimizer estimates a meaningful chance the recommended instance type cannot handle the workload. -
NEVER treat
Underprovisionedas UNDERUTILIZED. An underprovisioned resource is overworked, not wasting money. It needs MORE capacity, not less. Underprovisioned always maps to NOT_OPTIMIZED. -
NEVER assume a Lambda function with 0 invocations is "optimized." Zero invocations means no utilization data — the finding is noise. Classify as NOT_OPTIMIZED: "insufficient invocation data."
-
NEVER right-size based on a single utilization metric. CPU-only data on an EC2 instance cannot tell you whether the instance is memory-bound, network-bound, or I/O-bound. Require at least 3 metrics for HIGH confidence.
-
NEVER recommend an ASG right-size as a quick fix. ASG recommendations require launch-template changes AND instance replacement — it is a higher-effort change that can take hours to roll out across a fleet.
-
NEVER ignore
lastRefreshTimestamp. A finding older than 30 days describes a workload that may no longer exist. Stale findings are NOT_OPTIMIZED until refreshed. -
NEVER assume all
Overprovisionedfindings are equally valuable. A finding withestimatedMonthlySavingsof $2 is noise; a finding with $500 is a priority. Use savings magnitude to triage, not just finding count. -
NEVER recommend migrating a gp2 EBS volume to gp3 solely based on an
Overprovisionedfinding without checking IOPS/throughput utilization. gp3 has lower baseline performance (3,000 IOPS / 125 MiB/s) than gp2 (which scales IOPS with size). A gp2 volume at 10,000 IOPS will LOSE performance on gp3 unless additional provisioned IOPS are purchased. -
NEVER change an EC2 instance type without stopping it first.
modify-instance-attribute --instance-typerequires the instance to be stopped. Attempting it on a running instance returnsIncorrectInstanceState. -
NEVER accept a recommendation option at index 0 blindly. The first option is ranked by savings (cheapest), not by safety. Check
performanceRiskon every option — the safest may be index 1 or 2. -
NEVER assume Compute Optimizer is enrolled for all resource types. EC2, EBS, Lambda, and ECS enrollments are independent. An account enrolled for EC2 may not be enrolled for Lambda — check
get-enrollment-statusfor each resource type before expecting findings. -
NEVER overlook the effort of migrating instance families (e.g., m5 → t3). Same-family right-sizes (m5.2xlarge → m5.large) are low-effort; cross- family changes (m5 → t3) may require AMI changes, driver compatibility checks, and application testing.
Pre-flight safety checks (run before any remediation CLI)
Moved verbatim to references/diagnostic-commands.md - load on demand (see References below).
Remediation guidance
Moved verbatim to references/error-handling.md - load on demand (see References below).
Deep reference: Compute Optimizer internals
Moved verbatim to references/advanced-patterns.md - load on demand (see References below).
Recent AWS features (2024-2026)
Moved verbatim to references/advanced-patterns.md - load on demand (see References below).
References (load on demand)
- references/worked-examples.md — secondary worked example (LOW-confidence inferred memory) moved from SKILL.md
- references/advanced-patterns.md — expert edge cases, deep internals reference, 2024-2026 features moved from SKILL.md
- references/diagnostic-commands.md — live pre-flight checks + pre-rightsize safety checks moved from SKILL.md
- references/error-handling.md — per-verdict remediation guidance moved from SKILL.md
Domain
AWS CloudOps / Compute Cost Optimization & Right-Sizing.
AWS documentation
- AWS Compute Optimizer User Guide — https://docs.aws.amazon.com/compute-optimizer/latest/ug/what-is.html
- Compute Optimizer Security — https://docs.aws.amazon.com/compute-optimizer/latest/ug/security.html
- Compute Optimizer API Reference — https://docs.aws.amazon.com/compute-optimizer/latest/APIReference/
- Compute Optimizer CLI Reference — https://docs.aws.amazon.com/cli/latest/reference/compute-optimizer/
04 同仓库更多 Skills
xray-tracing-deployer
Deploys AWS X-Ray distributed tracing with production-grade configuration: X-Ray daemon deployment (EC2 systemd, ECS sidecar, EKS DaemonSet, Lambda built-in), SDK instrumentation (Java, Python, Node.js, Go, .NET) with annotations and metadata, sampling rules (default reservoir + rate vs custom rules with URL / method / service-name predicates), service map generation, trace query and retrieval, groups and insights, CloudWatch ServiceLens integration, IAM permissions (PutTraceSegments, GetSamplingRules), and latest features (Lambda Powertools tracing, OpenTelemetry / ADOT Collector support, W3C trace context). Emits a READY_TO_DEPLOY checklist with every configuration item verified. Use when enabling X-Ray on a new application, adding tracing to ECS / EKS / Lambda, validating a sampling configuration, or generating daemon deployment CLI and IaC templates. Triggers: X-Ray, distributed tracing, X-Ray daemon, sampling rules, service map, X-Ray SDK, OpenTelemetry, ADOT, Lambda Powertools, CloudWatch ServiceLens.
wellarchitected-workload-auditor
Audits AWS Well-Architected Tool workloads for review staleness, per-pillar high-risk issue counts, milestone tracking gaps, and remediation plan completeness. Emits a deterministic verdict (STALE_REVIEW | HIGH_RISK | CONFIG_GAP | OK) per workload with per-pillar risk breakdown, milestone trend analysis, and specific remediation. Use when reviewing Well-Architected workloads, checking WA review freshness, auditing high-risk issues per pillar, validating milestone coverage, or tracking remediation plans.
wellarchitected-review-operator
Operates AWS Well-Architected Tool reviews end-to-end — creates workloads, runs pillar reviews (operational excellence, security, reliability, performance, cost optimization, sustainability, Prosperity), answers questions with risk-tier rationale, generates reports and improvement plans, creates milestones, and integrates with Trusted Advisor and Well-Architected Labs. Runs deterministic pre-checks (workload existence, lens availability, pillar coverage), emits the exact update-answer / get-consolidated-report CLI behind a CONFIRM gate, and verifies risk-tier transitions. Emits READY | BLOCKED | COMPLETED. Use when creating a workload, answering pillar questions, generating an improvement plan, creating a milestone, or integrating with Trusted Advisor. Triggers: well-architected tool, well architected review, workload review, pillar, operational excellence, security, reliability, performance, cost optimization, sustainability, prosperity, improvement plan, milestone, trusted advisor.
wafv2-web-acl-deployer
Provisions AWS WAFv2 Web ACLs with correct production defaults: scope selection (CLOUDFRONT vs REGIONAL), managed rule groups (AWSManagedRulesCommonRuleSet, SQLiRuleSet, LinuxRuleSet, WindowsRuleSet, IPReputationList, BotControlRuleSet, AmazonIpReputationList, ATP), custom rules (byte match, IP set, regex pattern, geo match, size constraint, rate-based), rule priority ordering, logging destinations (Kinesis Firehose, CloudWatch Logs, S3), resource association (ALB, API Gateway, CloudFront), rate-based rules with aggregate keys (IP, forwarded IP), Challenge and CAPTCHA actions, and account takeover prevention. Emits a READY_TO_DEPLOY checklist. Use when creating a Web ACL, attaching managed rules, configuring rate limiting, enabling WAF logging, associating a Web ACL with an ALB/API Gateway/CloudFront, or configuring CAPTCHA/Challenge actions. Triggers: create WAF Web ACL, WAFv2, managed rule groups, WAF rate limiting, WAF logging, WAF CAPTCHA, WAF Challenge action, bot control, ATP managed rules.
wafv2-web-acl-auditor
Audits AWS WAFv2 Web ACL configurations to determine whether the ACL provides effective protection: default-action posture (Allow vs Block), managed-rule-group coverage gaps, rule effectiveness (BLOCK vs COUNT, shadow/bypass rules, stale exclusions), rate-based rule correctness, logging and visibility configuration, and text-transformation bypass vectors. Emits a deterministic verdict per Web ACL. Use when reviewing a WAFv2 Web ACL for security posture, checking managed-rule coverage, validating rate-limit configuration, auditing WAF logging, or hardening a WAF before production deployment. Triggers: WAF, WAFv2, Web ACL, managed rule group, AWSManagedRules, rate-based rule, CAPTCHA, Challenge, OverrideAction, Count mode, forwarded IP, Bot Control, ATP, text transformation, WAF logging, WAF visibility, OWASP, SQLi, XSS, RFI.
waf-rule-deployer
Provisions AWS WAFv2 rule sets with production defaults: Web ACL creation (CloudFront scope in us-east-1 vs Regional scope), rule groups (managed vs custom) with capacity planning in WCU (Web ACL Capacity Units, 1500 default per ACL), managed rule groups (AWSManagedRulesCommonRuleSet, AWSManagedRulesSQLiRuleSet, AWSManagedRulesAmazonIpReputationList, AWSManagedRulesLinuxRuleSet, AWSManagedRulesWindowsRuleSet, AWSManagedRulesUnixRuleSet), custom rules (byte-match, regex pattern set, geo-match, rate-based), IP set and regex pattern set resources, rule priority ordering (lowest number evaluated first), action types (allow, block, count, CAPTCHA, Challenge), bot control managed rule group, account takeover. Triggers: create WAF rule, WAF managed rule group, WAF custom rule, WAF byte match, WAF geo match, WAF rate based rule, WAF IP set, WAF regex pattern set, WAF WCU budget, WAF CloudFront ACL, WAF logging Kinesis Firehose, WAF bot control, WAF ATP, WAF label matching, WAF Challenge action, WAF CAPTCHA.