Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Helper Scripts

Miscellaneous scripts for automating mundane tasks.

Setup

pip install -r requirements.txt

Prerequisites

  • AWS credentials configured (~/.aws/credentials or environment variables)
  • IAM permission: ce:GetCostAndUsage

AWS Scripts

aws/cost_baseline.py — AWS Cost Baseline

Fetches last quarter's AWS costs from Cost Explorer and breaks them down three ways:

  1. Raw unblended cost — straight from Cost Explorer
  2. Cost excluding SavingsPlan negations — removes SP credit line items
  3. RI value — computes Reserved Instance value as covered hours × hourly price

Final output is (2) + (3), giving a true apples-to-apples cost baseline.

Configure RI pricing (edit the file before running):

# scripts/aws/cost_baseline.py, line 8
RI_PRICING = {
    "db.r6g.large": 0.1942,   # add your instance types and hourly prices here
}

Run:

python scripts/aws/cost_baseline.py

Sample output:

Range: 2026-01-01 → 2026-04-01

1. Raw cost:
{'2026-01-01': 12345.67, '2026-02-01': 11890.23, '2026-03-01': 12100.50}

2. Cost excluding SavingsPlanNegation:
{'2026-01-01': 13500.00, ...}

3. RI computed value (hours * price):
{'2026-01-01': 420.34, ...}

Final (2 + 3):
{'2026-01-01': 13920.34, ...}
Total: 41500.12

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages