Contents

Chapter 1

What's Included

This chapter covers the core features and capabilities of Cloud Cost Optimization Toolkit.

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
Chapter 2

Quick Start

Follow this guide to get Cloud Cost Optimization Toolkit up and running in your environment.

Quick Start

1. Deploy Budget Alerts (Terraform)

bash
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)

bash
aws 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

3. Run Rightsizing Analysis

bash
# 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 70

4. Generate Cost Dashboard Data

bash
python3 scripts/cost_dashboard_generator.py --output-format html

Configuration Reference

Terraform Variables (terraform/variables.tf)

VariableTypeDefaultDescription
monthly_budget_amountnumber5000Monthly budget threshold in USD
alert_thresholdslist(number)[50, 80, 100, 120]Percentage thresholds that trigger alerts
alert_emailstring—Email address for budget notifications
alert_slack_webhookstring""Optional Slack webhook for notifications
anomaly_detection_thresholdnumber20Percentage above expected spend to flag as anomaly
environmentstring"production"Environment tag for cost allocation
cost_centerstring—Cost center tag for chargeback
s3_transition_days_ianumber30Days before S3 objects transition to Infrequent Access
s3_transition_days_glaciernumber90Days before S3 objects transition to Glacier
enable_anomaly_detectionbooltrueEnable AWS Cost Anomaly Detection

Script Configuration (examples/rightsizing_rules.yaml)

See examples/rightsizing_rules.yaml for the full configuration reference. Key settings:

  • CPU threshold: Flag instances with avg CPU < 20% over 14 days
  • Memory threshold: Flag instances with avg memory < 30% over 14 days
  • Network threshold: Flag instances with avg network < 5 Mbps
  • Minimum observation period: 14 days of CloudWatch data required
  • Exclusion patterns: Skip instances by tag, name pattern, or instance family

Cost Optimization Strategies Covered

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)

Chapter 3
🔒 Available in full product

Cost Impact

Chapter 4
🔒 Available in full product

License

You’ve reached the end of the free preview

Get the full Cloud Cost Optimization Toolkit and unlock everything.

All Chapters

Get the complete guide with every chapter unlocked, including code samples, diagrams, and best practices.

Full Tool Suite

Access all interactive tools with complete data, all workload profiles, and the full scenario library.

Source Files

Downloadable source code, configuration files, and working examples from every chapter.

Lifetime Updates

Free updates for life. Every new chapter, tool, and improvement included.

Buy Now — $39 →
📦 Free sample included — download another copy for the full product.
Cloud Cost Optimization Toolkit v1.0.0 — Free Preview