@webframp/aws/cost-estimate
v2026.04.22.1
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)
Repository
https://github.com/webframp/swamp-extensions
Labels
Contents
Quality score
How well-documented and verifiable this extension is.
Grade A
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types1/1earned
- Has description1/1earned
- At least one platform tag (or universal)1/1earned
- Two or more platform tags (or universal)1/1earned
- License declared1/1earned
- Verified public repository2/2earned
Install
$ swamp extension pull @webframp/aws/cost-estimate| 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
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: ```bash # 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: ```bash 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)
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: ```bash # 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: ```bash 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)
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: ```bash # 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: ```bash 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)
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: ```bash # 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: ```bash 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)
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: ```bash # 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: ```bash 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)
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: ```bash # 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: ```bash 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)