cloudcost-doctor
NewAudit infrastructure-as-code (Terraform, CloudFormation, CDK) for cloud cost anti-patterns BEFORE deployment. Finds overprovisioned instances, expensive storage defaults, idle resources, missing lifecycle policies, and 45+ more — no AWS credentials required. Use when reviewing or cost-optimizing IaC.
Summary
CloudCost Doctor audits your Infrastructure-as-Code (Terraform, CloudFormation, CDK) for over 50 cost anti-patterns before deployment, catching overprovisioned instances, expensive storage defaults, idle resources, and missing lifecycle policies.
- It works offline without AWS credentials, making it ideal for code review, pre-commit checks, and CI/CD pipelines to prevent cloud waste.
Overview
cloudcost-doctor
Find cloud waste before you deploy it. Reads your Terraform / CloudFormation / CDK files and flags cost anti-patterns. No AWS credentials, no dependencies, works offline in <1 second.
When to use
- •Before running
terraform apply/aws cloudformation deploy - •During code review of infrastructure PRs
- •When asked "are we wasting money on AWS?"
- •As a pre-commit / CI check for IaC
How to run
# Audit a directory of IaC files
python3 scripts/cli.py audit <path>
# Single file
python3 scripts/cli.py audit main.tf
# JSON output for CI/CD
python3 scripts/cli.py audit <path> --json
# List all rules
python3 scripts/cli.py describeWhat it checks (50+ rules across 8 categories)
EC2 — Compute
- •
EC2.01Old instance generation (t2→t3, m4→m6i, c4→c6i: ~20% cheaper) - •
EC2.02Overprovisioned instance for likely dev/staging (8xlarge+ with no prod tag) - •
EC2.03No shutdown schedule for non-prod (add schedule or use Spot) - •
EC2.04On-demand for batch/stateless workloads (use Spot: 70-90% cheaper) - •
EC2.05No hibernate/stop on termination for dev instances - •
EC2.06Burstable instance without CloudWatch CPU credit monitoring - •
EC2.07EBS-optimized flag on instance types that include it free (dead config) - •
EC2.08Multiple ENIs without need (adds cost on some types) - •
EC2.09Placement group for non-HPC workload - •
EC2.10Dedicated host tenancy without licensing justification - •
EC2.11EIP attached to stopped instance ($3.60/mo) - •
EC2.12No instance profile / IAM role (security + operational debt)
EBS — Block Storage
- •
EBS.01gp2 volume — use gp3 (20% cheaper, better baseline IOPS) - •
EBS.02io1/io2 Block Storage with no measured IOPS need - •
EBS.03Overprovisioned volume size (>1TB without lifecycle) - •
EBS.04Snapshot without delete-after-N-days - •
EBS.05EFS without lifecycle to Infrequent Access
S3 — Object Storage
- •
S3.01Bucket with no lifecycle policy (logs grow forever in Standard) - •
S3.02Standard storage for logs/backups (→ IA/Glacier) - •
S3.03Versioning on without lifecycle (old versions accumulate) - •
S3.04No Intelligent-Tiering consideration for unknown access patterns - •
S3.05Cross-region replication without explicit DR requirement - •
S3.06Requester-pays without metering
RDS — Databases
- •
RDS.01Multi-AZ for dev/staging (doubles cost) - •
RDS.02RDS gp2 storage — use gp3 - •
RDS.03Provisioned IOPS (io1) on RDS without measured need - •
RDS.04Backup retention >7 days for non-prod - •
RDS.05T2/T3 instance — check if T4g available (ARM, cheaper) - •
RDS.06DynamoDB provisioned capacity without auto-scaling - •
RDS.07DynamoDB without on-demand for low/unknown traffic
NAT — Networking
- •
NAT.01NAT Gateway in non-prod (use VPC endpoints: saves $32/mo + data) - •
NAT.02Multiple NAT Gateways in one AZ - •
NAT.03Classic Load Balancer (deprecated, switch to ALB/NLB) - •
NAT.04Elastic IP not associated ($3.60/mo each) - •
NAT.05VPC endpoint not used for S3/DynamoDB (paying NAT data fees) - •
NAT.06Public IP on EC2 that doesn't need it
TAG — Governance
- •
TAG.01MissingOwnertag - •
TAG.02MissingEnvironmenttag (blocks cost allocation) - •
TAG.03MissingCostCenter/Projecttag - •
TAG.04Inconsistent tag casing (envvsEnvironment) - •
TAG.05No budget alert / cost anomaly detection configured - •
TAG.06Resources using deprecated tag keys
IAM — Security (cost-adjacent)
- •
IAM.01Overly permissive*resource policy - •
IAM.02IAM policy withAction: *andResource: * - •
IAM.03Hardcoded credentials in IaC (security + rotation cost) - •
IAM.04KMS key without rotation enabled
CW — CloudWatch / Logging
- •
CW.01Log group with no retention (infinite growth) - •
CW.02Detailed monitoring enabled for non-prod - •
CW.03CloudWatch Logs Insights without savings plan - •
CW.04High-resolution custom metrics where standard suffices
Reading the report
Each finding shows:
- •Severity: HIGH (clear waste, easy fix), MED (likely waste), LOW (governance hygiene)
- •Rule ID: e.g.
EC2.01 - •File:line: exact location in your IaC
- •Estimated savings: monthly $ range where calculable
- •Fix hint: one-line action to resolve
Pro tier
The free OSS scanner audits IaC files. The Pro tier (license-gated) adds:
- •Live AWS account scan (audit running infra, not just code)
- •Automated remediation (generates the fixing Terraform)
- •Cost trend dashboards
- •Slack/Teams alerting
Upgrade at https://takeaseatventure.com/pro
Limitations
- •Reads IaC files as parsed text (regex-based) — fast and universal, but cannot
resolve module references or dynamic expressions. For those, review the flagged resource manually.
- •AWS-focused. GCP/Azure support is planned.
- •Savings estimates are approximate (based on public AWS pricing, us-east-1).
Pro tips
- •Run in CI to catch waste before merge:
python3 scripts/cli.py audit ./infra --json - •The
describecommand lists every rule with its fix hint — useful for onboarding. - •Tagging findings (TAG.*) are prerequisites for any FinOps program — fix these first.
Install & Usage
mkdir -p .claude/skillsAdd the configuration to .claude/skills/cloudcost-doctor.md
/cloudcost-doctorUse Cases
Usage Examples
/cloudcost-doctor audit ./terraform/production --json
Audit my CloudFormation templates for cost issues before I deploy
Check this CDK app for expensive storage defaults and idle resources
Security Audits
Frequently Asked Questions
What is cloudcost-doctor?
CloudCost Doctor audits your Infrastructure-as-Code (Terraform, CloudFormation, CDK) for over 50 cost anti-patterns before deployment, catching overprovisioned instances, expensive storage defaults, idle resources, and missing lifecycle policies. It works offline without AWS credentials, making it ideal for code review, pre-commit checks, and CI/CD pipelines to prevent cloud waste.
How to install cloudcost-doctor?
To install cloudcost-doctor: create the skills directory (mkdir -p .claude/skills), then add the config to .claude/skills/cloudcost-doctor.md. Finally, /cloudcost-doctor in Claude Code.
What is cloudcost-doctor best for?
cloudcost-doctor is a other categorized under General. It is designed for: code-review, deployment. Created by takeaseatventure.
What can I use cloudcost-doctor for?
cloudcost-doctor is useful for: Before running terraform apply, audit your Terraform files to catch overprovisioned instances and expensive defaults.; During code review of infrastructure PRs, automatically flag cost anti-patterns without needing AWS credentials.; As a pre-commit hook or CI check, prevent costly resources from being deployed in the first place.; When asked 'are we wasting money on AWS?', scan your IaC repository to identify savings opportunities.; For batch or stateless workloads, detect on-demand instances that should be Spot to save 70-90%.; Audit non-production environments for missing shutdown schedules or overprovisioned instance sizes..