Skip to main content

@webframp/aws/cost-explorer

v2026.04.14.1

Query AWS Cost Explorer for actual spend analysis by service, usage type, and time period. Identifies top cost drivers and spend trends.

Authentication

Uses the default AWS credential chain.

Required IAM Permissions

  • ce:GetCostAndUsage

Usage

swamp model create @webframp/aws/cost-explorer aws-costs \
  --global region=us-east-1

# Spend breakdown by service (last 30 days)
swamp model method run aws-costs get_cost_by_service

# Drill into a service's usage types
swamp model method run aws-costs get_cost_by_usage_type \
  --input service=Amazon Elastic Compute Cloud - Compute

# Daily cost trend
swamp model method run aws-costs get_cost_trend --input days=30

# Top 20 cost drivers
swamp model method run aws-costs get_top_cost_drivers

Repository

https://github.com/webframp/swamp-extensions

Labels

awscostfinopscost-explorerbilling

Contents

Install

$ swamp extension pull @webframp/aws/cost-explorer

@webframp/aws/cost-explorerv2026.04.12.1aws/cost_explorer.ts
get_cost_by_serviceBreak down spend by AWS service for the given number of days
get_cost_by_usage_typeBreak down a single service's spend by usage type
ArgumentTypeDescription
servicestringAWS service name to drill into
get_cost_trendShow daily cost trend and determine if spend is increasing, decreasing, or stable
get_top_cost_driversIdentify the top cost drivers by service and usage type combination
get_cost_comparisonCompare costs between current and previous period by service

Resources

costs(1h)— AWS Cost Explorer query results