A highly configurable console application for computing ECS Fargate costs under various execution scenarios.
Define clusters of tasks by specifying:
- the number of Savings Plan tasks (24 hours/day)
- the number of On Demand tasks (along with the estimated start/end times)
This allows you to tweak various combinations of Savings Plan vs. On Demand tasks accounting for scaling scenarios (e.g., bell curve throughput).
dotnet run --output ./Files/Output --config ./Files/Input/SavingsPlanScaling.yml --config ./Files/Input/OnDemandScaling.yml --config ./Files/Input/OnDemand24x7.ymldotnet publish -c Release -o ./publish/aws-pricing
cd ./publish/aws-pricing
./aws-pricing.exe --output ./Files/Output --config ./Files/Input/SavingsPlanScaling.yml --config ./Files/Input/OnDemandScaling.yml --config ./Files/Input/OnDemand24x7.ymlEach configuration file is a YAML document specifying:
- CPU and memory (must match valid Fargate task configurations)
- Task scheduling (start/end times - military time)
- Number of tasks
- Desired pricing model (Savings Plan and/or On-Demand)
region: us-east-2
discounts:
enterprise: 0.15
savingsPlan: 0.2
clusters:
- name: prod
cpu: 8
gb: 16
tasks:
savingsPlan:
- tasks: 2
onDemand:
- tasks: 4
hours: [4, 20]
- tasks: 2
hours: [8, 16]The application writes two types of outputs per configuration file:
-
Text:
./Files/Output/text/*.txtA human-readable report with per-task and per-cluster pricing.
-
JSON:
./Files/Output/json/*.jsonStructured pricing data for downstream integration.
Additionally, it prints a summary to the console:
SavingsPlanScaling = $27,041.24 C:\path\to\SavingsPlanScaling.yml
OnDemandScaling = $32,269.63 C:\path\to\OnDemandScaling.yml
OnDemand24x7 = $42,890.02 C:\path\to\OnDemand24x7.yml
- CPU:
$0.04048per vCPU-hour - Memory:
$0.004445per GB-hour - Discounts:
- Savings Plan:
20% - Enterprise:
15%(applied after Savings Plan discount)
- Savings Plan:
Final cost = (Base CPU + Memory cost) × (1 - savingsPlan%) × (1 - enterprise%)
src/
├── Pricing/
│ ├── Files/ # Example input config files and output files
│ ├── Models/ # Domain models for config, pricing, and Fargate logic
│ ├── Strategies/ # Output format strategies (JSON, text)
│ ├── Visitors/ # Visitor pattern to decouple logic for price, display, etc.
│ ├── App.cs # Main orchestrator for CLI
│ ├── Program.cs # Bootstrapper and Host configuration
│ └── aws-pricing.appsettings.json
Currently limited to:
- Region:
us-east-2(hardcoded pricing for now) - Platform: Linux, x86 architecture
- Ephemeral Storage: 20 GB (free tier)
- Pricing Models: On-Demand and 1-year No Upfront Savings Plan
Kyle Kolander https://github.com/krk-architect/aws-pricing
© 2025 Kyle. All rights reserved.