🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

slate-cost

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slate-cost

Pre-deploy AWS cost estimation for CDK infrastructure

latest
Source
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

slate

You used AI to write your infrastructure. Now know exactly what it costs — before you deploy.

A zero-config CLI tool that reads your cdk synth output, calls the AWS Price List API for real prices, and produces a tiered cost estimate table across user growth scenarios.

Why

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. This tool makes that visible before you deploy.

How It Works

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

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 shown across 0–100, 100–1k, 1k–10k, 10k–100k, 100k–1M users
  • Free tier modeling — accurate $0 estimates at low usage (--no-free-tier to disable)
  • Cost drift detection — diffs between runs show what changed and by how much
  • Interactive wizard — guided CLI to fill in usage assumptions field by field
  • CI/CD budget gate — exits code 1 if cost exceeds threshold
  • MCP server — expose cost tools to AI editors (Kiro, VS Code, Continue)
  • Multi-region — prices resources at their deployed region, not a default

Supported Resources

Fixed cost (priced exactly from plan): EC2, RDS, Aurora Provisioned, ECS Fargate, ElastiCache, NAT Gateway, OpenSearch, ALB/NLB, EKS Control Plane, MSK, WAF WebACL, Transfer Family, Route 53, Kinesis (provisioned)

Variable cost (scales with users, generates cost-profile.yaml fields): Lambda, API Gateway, DynamoDB, S3, CloudFront, Cognito, SQS, SNS, Step Functions, EventBridge, Secrets Manager, Bedrock, EKS Nodegroups, Aurora Serverless v2, WAF requests, Kinesis (on-demand), Transfer Family data

Quick Start

# Install
npm install --save-dev slate

# Run
npx cdk synth
npx slate estimate

# Interactive wizard to refine estimates
npx slate wizard

CLI Commands

CommandDescription
slate estimateFull pipeline — reads cdk.out/, outputs tier table
slate estimate --ciCI mode — exits 1 on budget failure, includes drift
slate estimate --no-free-tierDisable free tier deductions
slate estimate --jsonOutput as JSON
slate wizardInteractive profile wizard
slate driftShow drift between last two reports
slate initCreate config file with defaults

Configuration

slate.config.json:

{
  "region": "us-east-1",
  "iac": "cdk",
  "budget": {
    "tier": "1k-10k",
    "max_monthly_usd": 500,
    "use": "midpoint"
  }
}

The Precision Dial

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

Fields filledOutput
NoneAll variable costs shown as min–max range
SomeFilled fields exact, empty fields ranged
AllEvery line item exact

Requirements

  • Node.js 18+
  • AWS CDK installed with cdk synth working
  • IAM permission: pricing:GetProducts

Tech Stack

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

License

MIT

Keywords

aws

FAQs

Package last updated on 14 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts