This chapter covers the core features and capabilities of Cloud Cost Optimization Toolkit.
| Category | Files | Description |
|---|---|---|
| Terraform | budget_alerts.tf, cost_anomaly_detection.tf, s3_lifecycle_policies.tf, variables.tf | Deploy budget alarms, anomaly detection, and storage lifecycle policies |
| CloudFormation | budget-alerts-stack.yaml, cost-explorer-reports.yaml | AWS-native stacks for budget monitoring and scheduled Cost Explorer reports |
| Scripts | rightsizing_report.py, unused_resources_finder.py, reserved_capacity_planner.py, cost_dashboard_generator.py | Python stdlib-only analysis tools for cost optimization |
| Docs | architecture.md, cost_strategies.md, runbook.md | Reference architecture, 30+ optimization strategies, and operational runbook |
| Examples | budget_config.json, rightsizing_rules.yaml | Ready-to-use configuration files for the toolkit |
+------------------+ +-----------------+ +------------------+
| 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
aws configure)ce:*, budgets:*, ec2:Describe*, rds:Describe*, s3:Get*, cloudwatch:PutMetricAlarmFollow this guide to get Cloud Cost Optimization Toolkit up and running in your environment.
cd terraform/
# Review and customize variables
cp terraform.tfvars.example terraform.tfvars
vim terraform.tfvars
terraform init
terraform plan
terraform applyaws cloudformation deploy \
--template-file cloudformation/budget-alerts-stack.yaml \
--stack-name cost-optimization-budgets \
--parameter-overrides \
MonthlyBudgetAmount=5000 \
AlertEmail=finops@example.com \
--capabilities CAPABILITY_IAM# Generate a rightsizing report from mock data
python3 scripts/rightsizing_report.py
# Find unused resources
python3 scripts/unused_resources_finder.py
# Plan reserved capacity purchases
python3 scripts/reserved_capacity_planner.py --utilization-threshold 70python3 scripts/cost_dashboard_generator.py --output-format htmlterraform/variables.tf)| Variable | Type | Default | Description |
|---|---|---|---|
monthly_budget_amount | number | 5000 | Monthly budget threshold in USD |
alert_thresholds | list(number) | [50, 80, 100, 120] | Percentage thresholds that trigger alerts |
alert_email | string | — | Email address for budget notifications |
alert_slack_webhook | string | "" | Optional Slack webhook for notifications |
anomaly_detection_threshold | number | 20 | Percentage above expected spend to flag as anomaly |
environment | string | "production" | Environment tag for cost allocation |
cost_center | string | — | Cost center tag for chargeback |
s3_transition_days_ia | number | 30 | Days before S3 objects transition to Infrequent Access |
s3_transition_days_glacier | number | 90 | Days before S3 objects transition to Glacier |
enable_anomaly_detection | bool | true | Enable AWS Cost Anomaly Detection |
examples/rightsizing_rules.yaml)See examples/rightsizing_rules.yaml for the full configuration reference. Key settings:
This toolkit addresses the top cost optimization levers:
1. Right-sizing -- Downsize over-provisioned EC2/RDS instances (typical savings: 20-40%)
2. Reserved capacity -- Identify RI/Savings Plan purchase opportunities (typical savings: 30-60%)
3. Unused resources -- Find and eliminate idle EBS volumes, unattached EIPs, empty load balancers
4. Storage lifecycle -- Automate S3 tiering from Standard to IA to Glacier
5. Budget guardrails -- Prevent surprise bills with multi-threshold alerts
6. Anomaly detection -- Catch unexpected spend spikes within hours, not at month-end
7. Scheduling -- Start/stop dev/test resources on a schedule (covered in runbook)
Get the full Cloud Cost Optimization Toolkit and unlock everything.
Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.
Access all interactive tools with complete data, all workload profiles, and the full scenario library.
Downloadable source code, configuration files, and working examples from every chapter.
Free updates for life. Every new chapter, tool, and improvement included.