All skills
aws avatar

/aws-billing-and-cost-management

@b33847d

Analyze AWS costs, find savings, manage budgets, evaluate Savings Plans and Reserved Instances, right-size EC2/Lambda/RDS/EBS with Compute Optimizer, look up service pricing, query CUR with Athena, detect cost anomalies, scope costs to billing views, and monitor Free Tier usage. Triggers on: AWS bill, cost analysis, reduce spend, savings plan, reserved instance, right-size, budget alert, cost optimization, pricing, free tier, cost anomaly, CUR, cost audit, billing view, billing view ARN.

Use this Skill: https://skilld.dev/gh/aws/agent-toolkit-for-aws/aws-billing-and-cost-management

This session only. Nothing lands on disk.

referencesec2-rightsizing.md

≈835 tokens on demand. Your agent reads this file only when SKILL.md points to it.

EC2 Right-Sizing with Compute Optimizer

Prerequisites

Opt in first: aws compute-optimizer update-enrollment-status --status Active

Metrics Analyzed

Performance: CPU utilization, memory utilization (requires CloudWatch agent), GPU utilization/memory (requires CloudWatch agent + NVIDIA GPU)

Network: NetworkIn/Out bytes/sec, packets in/out per second

EBS: Read/Write bytes/sec, Read/Write ops/sec

Instance Store: Disk read/write bytes/sec, disk read/write ops/sec

Memory metrics are critical — without them, instances with low memory may appear optimized. Memory metrics enable up to 4x more savings opportunities. Recommend CloudWatch agent installation.

Finding Classifications

Finding Meaning
Overprovisioned Can be downsized while meeting workload needs
Underprovisioned Too small, risking performance issues
Optimized Appropriately sized
NotOptimized Could benefit from newer generation or family

Finding Reason Codes

Each finding includes reason codes explaining which metrics triggered it: CPUOverprovisioned, CPUUnderprovisioned, MemoryOverprovisioned, MemoryUnderprovisioned, EBSThroughputOverprovisioned, NetworkBandwidthOverprovisioned, GPUOverprovisioned, etc. Found in findingReasonCodes array.

Lookback Periods

Period Datapoints Cost
14-day (default) ~4,032 Free
32-day ~9,216 Free (enhanced)
93-day ~26,784 Paid (enhanced infrastructure metrics)

Uses P99.5 percentile by default (excludes top 0.5% outliers). Default 20% CPU/memory headroom buffer.

Migration Effort Levels

Level Example
Very Low Same family size change (c5.large → c5.xlarge)
Low Generation change (m5.xlarge → m6i.xlarge)
Medium Family change (c5.xlarge → m5.xlarge)
High Architecture change (x86 → Graviton/arm64)

Performance Risk Scale

0-1: Very Low | >1-2: Low | >2-3: Medium | >3-4: High

Savings Estimation Modes

Check effectiveRecommendationPreferences.savingsEstimationMode.source:

  • PublicPricing: On-Demand pricing (default)
  • CostExplorerRightsizing: Incorporates SP/RI discounts
  • CostOptimizationHub: Custom pricing

If only savingsOpportunity is present, calculation uses On-Demand. If savingsOpportunityAfterDiscounts is also present, compare both.

CLI Commands

# Over-provisioned EC2 instances
aws compute-optimizer get-ec2-instance-recommendations \
  --filters Name=Finding,Values=Overprovisioned

# Idle resources (near-zero utilization)
aws compute-optimizer get-idle-recommendations

# Export to S3 for bulk analysis
aws compute-optimizer export-ec2-instance-recommendations \
  --s3-destination-config bucket=my-bucket,keyPrefix=ec2-recs \
  --file-format Csv

Analyzing a Recommendation

When presenting a right-sizing recommendation to the user, include:

  1. Current instance type and specs (vCPUs, memory)
  2. Which metrics triggered the finding (with actual values)
  3. Recommended instance type and specs
  4. Monthly savings ($ and %) — calculate with a script, NEVER manually
  5. Migration effort level and any platform differences (Xen→Nitro, x86→arm64)
  6. Whether memory metrics were available (if not, recommend CloudWatch agent)

Source: SKILL.md on GitHub

No alerts17d3 checks · Risk SAFE
  • Gen Agent Trust Hub17d

    This skill provides comprehensive instructions for analyzing and optimizing AWS costs. It incorporates security-conscious patterns, such as recommending sandboxed execution via the AWS MCP server and requiring deterministic Python scripts for all mathematical calculations to ensure data integrity and accuracy.

  • Socket17d

    No alerts

  • Snyk17d

    Risk: LOW · No issues

Signed by skilld at b33847d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago
metadata
{
  "version": "1"
}

README badge

README badge for aws/agent-toolkit-for-aws/aws-billing-and-cost-management