Aws/cost Estimate
Calculate AWS infrastructure costs from inventory data or planned specs.
Authentication
Uses the default AWS credential chain. The Pricing API is public data but requires valid AWS credentials.
Usage
From Inventory (existing resources)
First gather inventory using @webframp/aws/inventory, then estimate costs:
# Create models
swamp model create @webframp/aws/inventory aws-inventory --global-arg region=us-east-1
swamp model create @webframp/aws/cost-estimate cost-est
# Gather inventory
swamp model method run aws-inventory list_ec2
# Get inventory data
EC2_DATA=$(swamp data get aws-inventory ec2-us-east-1 --json | jq '.data.resources')
# Estimate costs (pass inventory as JSON)
swamp model method run cost-est estimate_ec2 \
--input "inventory=${EC2_DATA}"From Spec (planned resources)
Estimate costs before deployment:
swamp model method run cost-est estimate_from_spec \
--input 'ec2Instances=[{"name":"web","instanceType":"t3.medium","count":3}]' \
--input 'rdsInstances=[{"name":"db","dbInstanceClass":"db.t3.medium","engine":"postgres","storageGb":100}]'Pricing Notes
- Uses AWS Pricing API for real-time rates
- Assumes On-Demand pricing (no Reserved Instances or Savings Plans)
- EC2: Includes compute only (no EBS, transfer)
- RDS: Includes compute + storage (gp2 rate default)
2026.08.21.2
Changed: AWS Pricing API failures in estimate_ec2, estimate_rds, and
estimate_from_spec now raise an error naming the failing GetProducts call
and the resource attributes being priced (instance type/DB class, engine,
region, platform, or Multi-AZ setting) instead of surfacing the raw AWS SDK
error with no context.
Changed: estimate_from_spec now requires at least one of ec2Instances
or rdsInstances to be provided, and rejects an empty array for either field
instead of silently producing a zero-cost estimate. count on ec2Instances
must be a positive integer and storageGb on rdsInstances must be positive.
Instance/DB identifiers, instance types, DB classes, and engine names must be
non-empty strings.
2026.08.21.1
Changed: Added .describe() documentation to the region, platform, multiAz, and storageGb fields in estimate_from_spec's ec2Instances/rdsInstances argument schemas, which previously lacked descriptions while their sibling fields already had them. No behavioral change.
| Argument | Type | Description |
|---|---|---|
| instanceId | string | |
| instanceType | string | |
| availabilityZone | string | |
| platform? | string | |
| tags? | record |
| Argument | Type | Description |
|---|---|---|
| dbInstanceId | string | |
| dbInstanceClass | string | |
| engine | string | |
| availabilityZone? | string | |
| multiAz | boolean | |
| allocatedStorage | number |
| Argument | Type | Description |
|---|---|---|
| name | string | Instance identifier/name |
| instanceType | string | EC2 instance type |
| region | string | |
| count | number | Number of instances |
| name | string | DB instance identifier |
| dbInstanceClass | string | RDS instance class |
| engine | string | Database engine |
| region | string | |
| multiAz | boolean | |
| storageGb | number |
Resources
2026.08.21.1
Changed: Added .describe() documentation to the region, platform, multiAz, and storageGb fields in estimate_from_spec's ec2Instances/rdsInstances argument schemas, which previously lacked descriptions while their sibling fields already had them. No behavioral change.
2026.08.20.1
Changed: Bump @aws-sdk/* 3.1111.0 → 3.1114.0 (2 packages)
2026.08.15.1
Changed: Bump @aws-sdk/* 3.1104.0 → 3.1111.0 (2 packages)
2026.08.05.1
Changed: Bump @aws-sdk/* 3.1101.0 → 3.1104.0 (2 packages)
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.30.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.30.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.30.1
Added: Optional profile global argument for multi-account credential resolution.
When set, credentials resolve via fromIni (supports SSO token cache and shared-config
profiles). When omitted, the default credential chain applies as before. Fully backward
compatible — no changes required for existing instances.
2026.08.15.1
Changed: Bump @aws-sdk/* 3.1104.0 → 3.1111.0 (2 packages)
2026.08.05.1
Changed: Bump @aws-sdk/* 3.1101.0 → 3.1104.0 (2 packages)
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.30.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.30.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.30.1
Added: Optional profile global argument for multi-account credential resolution.
When set, credentials resolve via fromIni (supports SSO token cache and shared-config
profiles). When omitted, the default credential chain applies as before. Fully backward
compatible — no changes required for existing instances.
2026.08.05.1
Changed: Bump @aws-sdk/* 3.1101.0 → 3.1104.0 (2 packages)
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.30.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.30.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.30.1
Added: Optional profile global argument for multi-account credential resolution.
When set, credentials resolve via fromIni (supports SSO token cache and shared-config
profiles). When omitted, the default credential chain applies as before. Fully backward
compatible — no changes required for existing instances.
2026.08.02.1
Changed: Bump @aws-sdk/* 3.1100.0 → 3.1101.0 (2 packages)
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.30.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.30.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.30.1
Added: Optional profile global argument for multi-account credential resolution.
When set, credentials resolve via fromIni (supports SSO token cache and shared-config
profiles). When omitted, the default credential chain applies as before. Fully backward
compatible — no changes required for existing instances.
2026.08.01.1
Fixed: Broken model-upgrade chain. The prior version bump (to 2026.07.31.1) updated version but left the upgrades array terminating one step short, which blocks swamp extension push ("model upgrade chain errors"). That version never actually published — the registry was still serving 2026.07.30.1. This release closes the chain with a no-op upgrade entry and republishes everything that had accumulated since 2026.07.30.1.
2026.07.31.1
Changed: Bump @aws-sdk/* 3.1096.0 → 3.1100.0 (2 packages)
2026.07.30.1
Added: Optional profile global argument for multi-account credential resolution.
When set, credentials resolve via fromIni (supports SSO token cache and shared-config
profiles). When omitted, the default credential chain applies as before. Fully backward
compatible — no changes required for existing instances.
2026.07.30.1
Added: Optional profile global argument for multi-account credential resolution.
When set, credentials resolve via fromIni (supports SSO token cache and shared-config
profiles). When omitted, the default credential chain applies as before. Fully backward
compatible — no changes required for existing instances.
2026.07.29.1
Fixed: Terminate upgrade chain at current version (extension was uninstallable due to broken upgrade chain).
2026.07.27.1
Changed: Bump @aws-sdk/client-pricing 3.1094.0 → 3.1096.0
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.07.24.1
Changed: Bump AWS SDK from 3.1091.0 to 3.1094.0 (patch-level update).
2026.07.21.1
Changed: Bumped AWS SDK dependencies to 3.1091.0 (from 3.1090.0).
Upgrade note: No behavioral changes. Routine dependency maintenance.
2026.07.18.2
Added: An upgrades array entry (no-op) to cost_estimate.ts for proper typeVersion tracking on existing instances. No schema or behavior changes.
2026.07.18.1
Changed: Bumped @aws-sdk/client-pricing from 3.1069.0 to 3.1090.0
for dependency freshness. No behavior change.
2026.07.18.1
Changed: Bumped @aws-sdk/client-pricing from 3.1069.0 to 3.1090.0
for dependency freshness. No behavior change.
updated platforms
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned