← Back to all products

Cloud Cost Optimization Toolkit

$39

Scripts and dashboards for identifying waste, right-sizing instances, reserved capacity planning, and budget alerts.

📁 23 files
JSONPythonTerraformYAMLMarkdownAWSAzure

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 23 files

cloud-cost-optimization/ ├── LICENSE ├── README.md ├── cloudformation/ │ ├── budget-alerts-stack.yaml │ └── cost-explorer-reports.yaml ├── docs/ │ ├── architecture.md │ ├── cost_strategies.md │ └── runbook.md ├── examples/ │ ├── budget_config.json │ └── rightsizing_rules.yaml ├── free-sample.zip ├── guide/ │ ├── 01_what-s-included.md │ ├── 02_quick-start.md │ ├── 03_cost-impact.md │ └── 04_license.md ├── index.html ├── scripts/ │ ├── cost_dashboard_generator.py │ ├── reserved_capacity_planner.py │ ├── rightsizing_report.py │ └── unused_resources_finder.py └── terraform/ ├── budget_alerts.tf ├── cost_anomaly_detection.tf ├── s3_lifecycle_policies.tf └── variables.tf

📖 Documentation Preview README excerpt

Cloud Cost Optimization Toolkit

Identify waste, right-size instances, plan reserved capacity, and set budget alerts across AWS and Azure.

A battle-tested collection of Terraform/CloudFormation IaC templates, Python analysis scripts, and operational runbooks for cloud cost engineering. Built for FinOps practitioners and senior cloud engineers who need to cut spend without cutting performance.


What's Included

CategoryFilesDescription
Terraformbudget_alerts.tf, cost_anomaly_detection.tf, s3_lifecycle_policies.tf, variables.tfDeploy budget alarms, anomaly detection, and storage lifecycle policies
CloudFormationbudget-alerts-stack.yaml, cost-explorer-reports.yamlAWS-native stacks for budget monitoring and scheduled Cost Explorer reports
Scriptsrightsizing_report.py, unused_resources_finder.py, reserved_capacity_planner.py, cost_dashboard_generator.pyPython stdlib-only analysis tools for cost optimization
Docsarchitecture.md, cost_strategies.md, runbook.mdReference architecture, 30+ optimization strategies, and operational runbook
Examplesbudget_config.json, rightsizing_rules.yamlReady-to-use configuration files for the toolkit

Architecture Summary


+------------------+     +-----------------+     +------------------+
|  Cost Explorer   |---->|  Analysis       |---->|  Action Layer    |
|  & Billing APIs  |     |  Scripts        |     |                  |
+------------------+     +-----------------+     +------------------+
        |                       |                        |
        v                       v                        v
  Raw spend data         Rightsizing recs          Budget alerts
  Usage reports          Unused resources          Auto-remediation
  RI/SP coverage         Capacity planning         Slack/email notify

The toolkit operates in three layers:

1. Data Collection -- Pulls billing, usage, and reservation data via AWS/Azure APIs

2. Analysis -- Python scripts process the data to find savings opportunities

3. Action -- Terraform/CFn deploys alerts, policies, and automated remediation

Prerequisites

  • AWS CLI configured with credentials (aws configure)
  • Terraform >= 1.5.0 (for IaC templates)
  • Python >= 3.10 (for analysis scripts -- stdlib only, no pip packages)
  • IAM permissions: ce:, budgets:, ec2:Describe, rds:Describe, s3:Get*, cloudwatch:PutMetricAlarm

Quick Start

1. Deploy Budget Alerts (Terraform)


cd terraform/
# Review and customize variables
cp terraform.tfvars.example terraform.tfvars
vim terraform.tfvars

terraform init
terraform plan
terraform apply

2. Deploy Budget Alerts (CloudFormation)

... continues with setup instructions, usage examples, and more.

📄 Code Sample .py preview

scripts/cost_dashboard_generator.py #!/usr/bin/env python3 """ Cost Dashboard Data Generator ============================== Generates structured cost analysis data suitable for feeding into dashboards (Grafana, QuickSight, Tableau, or custom HTML reports). Produces: - Service-level cost breakdown (top N services) - Daily cost trend data (last 30/60/90 days) - Cost by environment tag (production vs staging vs dev) - Month-over-month growth analysis - Cost anomaly highlights - Unit cost metrics (cost per request, per user, per GB) Output formats: JSON (for API consumption) or self-contained HTML dashboard. Usage: python3 cost_dashboard_generator.py # JSON output python3 cost_dashboard_generator.py --output-format html # HTML dashboard python3 cost_dashboard_generator.py --days 90 # 90-day window No external dependencies -- Python stdlib only. """ import argparse import json import logging import random from datetime import datetime, timedelta from pathlib import Path logging.basicConfig( level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S", ) logger = logging.getLogger(__name__) # --------------------------------------------------------------------------- # Data Generation # --------------------------------------------------------------------------- # Service cost proportions (typical AWS workload) SERVICE_WEIGHTS: dict[str, float] = { "EC2 - Compute": 0.35, "RDS": 0.18, "S3": 0.08, "CloudFront": 0.06, "ElastiCache": 0.05, # ... 328 more lines ...
Buy Now — $39 Back to Products