Controls via Powerpipe
Tag, rightsizing and waste rules are SQL controls in a
bundled mod. Thresholds come from finops.yaml and are passed as mod variables, so one file holds
your company standards.
Architecture
spendlens is a Python CLI that turns AWS APIs into SQL with Steampipe, runs company-specific controls with Powerpipe, and keeps every result in a local history that reports, notifications and the AI assistant read.
Who uses spendlens, and what it talks to.
What runs inside spendlens, and how data moves between the parts.
Tag, rightsizing and waste rules are SQL controls in a
bundled mod. Thresholds come from finops.yaml and are passed as mod variables, so one file holds
your company standards.
Cost diff, trend, showback, anomalies and forecast query
Steampipe's Cost Explorer tables directly. Each period is one bounded API call, because exactly one
period_start/period_end pair is sent.
Every run is saved to SQLite: findings, cost rows, the
parameters used and CI metadata. The dashboard, notify, history diff and
ask read it offline.
Built-in features use the same registry as third-party plugins: commands, Powerpipe mods, savings estimators, AI tools and dashboard tabs.
What happens when the pipeline fires.
How a question becomes an answer, and why it can't change anything.
Steampipe's AWS plugin uses the standard credential chain: the role
assumed in your terminal, AWS_PROFILE, SSO, or OIDC web identity in CI. spendlens stores no AWS
keys.
1: a sqlglot parser allows one SELECT. 2: the
history DB opens read-only with a SQLite authorizer. 3: Steampipe sessions run with
default_transaction_read_only, a timeout and a row cap.
Claude goes through the official Anthropic SDK (Anthropic API or Bedrock with your AWS role). OpenAI, Azure OpenAI and OpenAI-compatible servers go through the official OpenAI SDK.
Unit tests; integration tests driving real SDKs and Powerpipe; and system tests that run the CLI end to end through Steampipe against an AWS emulator (Moto). An offline checker validates every control's SQL against the plugin schema.