Back to Solutions

Case Study

Slate - Pre-Deployment AWS Cost Estimation for CDK

Zero-config CLI that reads CDK synth output, calls AWS Price List API for real prices, and produces tiered cost estimates before deployment.

TypeScript (ESM)AWS CDKAWS Price List APICommander@inquirer/promptsjs-yamlchalktsup + vitest
30+ AWS servicesSupported Resources
5 growth scenarios (0 to 1M users)Cost Tiers
Zero-config after cdk synthConfiguration
Active DevelopmentStatus

Hats I Wore

Project Overview

AI-assisted IaC development generates working infrastructure fast — but a single configuration decision (NAT Gateway, multi-AZ RDS, DynamoDB billing mode change) can shift monthly costs by hundreds of dollars silently. Slate makes that visible before you deploy.

How It Works

cdk synth → CDK Adapter → Classifier → AWS Price List API → Free Tier Deduction → Calculator → Output
  1. CDK Adapter — reads cdk.out/manifest.json + CloudFormation templates, normalizes resources
  2. Classifier — categorizes each resource as Fixed (exact price) or Variable (scales with users)
  3. Pricing Client — calls AWS Price List API for region-accurate unit prices (never hardcoded)
  4. Free Tier — deducts AWS Free Tier allowances for accurate low-tier estimates
  5. Calculator — multiplies variable costs across user growth tiers
  6. Output — renders tier table, generates cost-profile.yaml, writes report JSON

Key Features

  • Zero config — works immediately after cdk synth with no setup
  • Real prices — all costs from AWS Price List API, never hardcoded
  • Tiered output — costs across 0–100, 100–1k, 1k–10k, 10k–100k, 100k–1M users
  • Free tier modeling — accurate $0 estimates at low usage
  • Cost drift detection — diffs between runs show what changed
  • CI/CD budget gate — exits code 1 if cost exceeds threshold
  • MCP server — expose cost tools to AI editors (Kiro, VS Code, Continue)
  • Interactive wizard — guided CLI to fill in usage assumptions

The Precision Dial

cost-profile.yaml is generated with fields for detected variable resources. Fill in what you know — leave blank what you don't.

| Fields filled | Output | |---|---| | None | All variable costs shown as min–max range | | Some | Filled fields exact, empty fields ranged | | All | Every line item exact |

Technologies

TypeScript, ESM, Commander, @aws-sdk/client-pricing, @inquirer/prompts, js-yaml, chalk, tsup, vitest

Interested in similar solutions?

Let's discuss how I can help architect and build scalable systems for your organization.