MCPcopy Index your code
hub / github.com/elC0mpa/aws-doctor

github.com/elC0mpa/aws-doctor @v2.21.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.21.1 ↗ · + Follow
1,313 symbols 3,935 edges 192 files 444 documented · 34% updated 31d agov2.21.1 · 2026-06-06★ 4234 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

aws-doctor

Website

awesome-go

Go Version Go Reference Go Report Card codecov GitHub all releases CI License

A terminal-based tool that acts as a comprehensive health check for your AWS accounts. Built with Golang, aws-doctor diagnoses cost anomalies, detects idle resources, and provides a proactive analysis of your cloud infrastructure.

[!TIP] View the full documentation, permissions guide, and usage examples at awsdoctor.compacompila.com

👀 Quick glance

⚖️ Comparative Cost Analytics

Comparative Cost Analytics

📈 6-Month Trend Analysis

6-Month Trend Analysis

🧟 Waste Detection

Waste Detection

Supports selective scanning: aws-doctor waste ec2 s3 cloudwatch rds vpc lambda sagemaker elb ecr secrets-manager iam

  • Interactive Terminal UI: Navigate seamlessly through detected waste categories using your keyboard arrows or tabs, complete with an aggregated Summary view.
  • Graceful Degradation: Running in CI/CD? aws-doctor automatically detects if it's being piped or redirected and gracefully falls back to static tables.

📄 Professional Reporting

aws-doctor can now generate detailed, professional PDF reports ready for stakeholders. Reports include branded headers, styled tables, and comprehensive cost/waste analyses.

[!TIP] View PDF reporting examples and details at awsdoctor.compacompila.com/docs/reporting/

Generate a Cost Comparison Report

aws-doctor report cost

Generate a Waste Analysis Report

# Full waste report
aws-doctor report waste

# Selective checks (e.g., ec2, s3, and lambda only)
aws-doctor report waste ec2 s3 lambda sagemaker

Generate a Trend Report

# Full trend report (all services)
aws-doctor report trend

# Selective services (e.g., ec2 and rds only)
aws-doctor report trend ec2 rds

[!TIP] Subcommand Arguments: Just like the terminal commands, report waste accepts specific checks (e.g., ec2, s3, rds, lambda) and report trend accepts specific service names.

[!TIP] By default, reports are saved in your Documents folder. Use the --path flag to specify a custom directory or filename: aws-doctor report cost --path ./billing-analysis.pdf

🚀 Installation

Homebrew (macOS/Linux):

brew install elC0mpa/homebrew-tap/aws-doctor

One-Line Script (macOS/Linux):

curl -sSfL https://raw.githubusercontent.com/elC0mpa/aws-doctor/main/install.sh | sh

Windows (PowerShell):

irm https://raw.githubusercontent.com/elC0mpa/aws-doctor/main/install.ps1 | iex

Using Go:

go install github.com/elC0mpa/aws-doctor@latest

✨ Key Features

  • 📄 Professional PDF Reports: Generate branded, ready-to-share PDF documents for costs, trends, and waste analysis.
  • 📉 Fair Cost Comparison: Compares identical time windows between months to spot real anomalies.
  • 🧟 Zombie Discovery: Scans for idle EIPs, stopped instances, idle running EC2 instances, orphaned snapshots, idle RDS instances, idle NAT Gateways, idle Load Balancers, over-provisioned Lambda memory, idle SageMaker real-time inference endpoints, ECR repositories with untagged images, missing lifecycle policies, or no images at all, unused Secrets Manager secrets, and unused IAM users or Root accounts without MFA. Supports selective service filtering (ec2, s3, elb, cloudwatch, rds, vpc, lambda, sagemaker, ecr, secrets-manager, iam).
  • 📊 6-Month Trends: High-fidelity ANSI visualization of your spending velocity.
  • 📤 Multiple Output Formats: Export results in table, json, or csv for easy integration with other tools or reporting.
  • 🔔 Update Notifications: Automatically checks for new versions in the background and notifies you after command output.
  • 🚀 Efficient Caching: Uses a local cache service to minimize redundant network calls. Currently used for version check notifications (2-hour TTL) and slated for expansion to pricing data and other heavy flows.
  • 🔐 MFA Ready: Native support for profiles requiring Multi-Factor Authentication.
  • 🌍 Region-Aware Pricing: Queries the AWS Pricing API at startup to use rates for the configured region, falling back to us-east-1 defaults if the API is unavailable. Requires pricing:GetProducts in the caller's IAM policy; without it, estimates silently fall back to defaults.

💡 Motivation

As a Cloud Architect, I often need to check AWS costs and billing information. While the AWS Console provides raw data, it lacks the immediate context I need to answer the question: "Are we spending efficiently?"

I created *aws-doctor* to fill that gap. It doesn't just show you the bill; it acts as a diagnostic tool that helps you understand *where* the money is going and *what* can be cleaned up. It automates the routine checks I used to perform manually, serving as a free, open-source alternative to the paid recommendations found in AWS Trusted Advisor.

👥 Community

Contributors

A huge thank you to everyone who has contributed to aws-doctor! Your help makes this tool better for everyone.

Contributors

Star History

Star History Chart

🤝 Contributing

We love contributions! Whether it's a new detection rule or a bug fix, check our Community Dashboard to get started.

[!IMPORTANT] Always target your Pull Requests to the development branch. The main branch is reserved for production-ready releases. Check our Contributing Guidelines for more details.

Extension points exported contracts — how you extend this code

WasteAnalyzer (Interface)
WasteAnalyzer defines the standard contract for all AWS service waste detectors. [13 implementers]
service/analyzer/types.go
Renderer (Interface)
Renderer defines the interface for formatting and outputting data. [4 implementers]
service/output/types.go
STSClientAPI (Interface)
STSClientAPI is the interface for the AWS STS client methods used by the service. [3 implementers]
service/sts/types.go
PricingService (Interface)
PricingService is an interface for calculating AWS costs. [2 implementers]
mocks/services/pricing_service.go
WasteService (Interface)
WasteService is the interface for the waste orchestrator service. [2 implementers]
service/orchestrator/types.go
CostExplorerClientAPI (Interface)
CostExplorerClientAPI is the interface for the AWS Cost Explorer client methods used by the service. [1 implementers]
service/costexplorer/types.go
Service (Interface)
Service is the interface for the cache service.
service/cache/types.go
ClientAPI (Interface)
ClientAPI is the interface for the AWS Secrets Manager client methods used by the service.
service/secretsmanager/types.go

Core symbols most depended-on inside this repo

Get
called by 177
service/cache/types.go
Run
called by 139
service/update/types.go
NewMockPricingService
called by 44
mocks/services/pricing_service.go
priceKey
called by 35
service/pricing/service.go
ToSlice
called by 28
utils/output_shared/shared.go
addWasteRow
called by 26
service/report/service_waste.go
termMatch
called by 24
service/pricing/service.go
Update
called by 22
service/update/types.go

Shape

Function 626
Method 462
Struct 152
Interface 58
TypeAlias 15

Languages

Go100%

Modules by API surface

utils/waste_table/waste_table.go62 symbols
utils/waste_table/waste_table_test.go38 symbols
utils/json_output/json_output.go36 symbols
model/output_json.go32 symbols
mocks/services/pricing_service.go31 symbols
service/pricing/service.go26 symbols
service/ec2/types.go26 symbols
utils/output_shared/waste_presenters.go25 symbols
utils/csv_output/waste_mappers.go25 symbols
service/pricing/service_test.go24 symbols
service/update/service_test.go23 symbols
service/pricing/types.go23 symbols

For agents

$ claude mcp add aws-doctor \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact