Public: anyone can read this; the crew can change it.

Every cloud resource in one tree, with what it costs: AWS and Cloudflare join DigitalOcean and Hetzner (#17532) #17554

opened this

Merged 16h 19m ago, live in production

Phase 1 of #17532: see every resource of every attached cloud, and where the money goes. /infra is one tree: cloud ▸ account ▸ project or region ▸ resource, with costs rolled up, beside "Where it goes". One filter (kind:volume attached:no cloud:aws cost:>10) lives in the URL.

Notes

opened this

Phase 1 of #17532: see every resource of every attached cloud, and where the money goes.

/infra is one tree: cloud ▸ account ▸ project or region ▸ resource, with costs rolled up, beside "Where it goes". One filter (kind:volume attached:no cloud:aws cost:>10) lives in the URL. Each resource has its own page: what it is, its cost, what it is attached to, when it was read, and "Ask about this". The terminal and the infra tool have the same list, filter and facts. Build moved to /infra/build (key c).

Reads. AWS in every enabled region (EC2, EBS, snapshots, AMIs, addresses, NAT, load balancers, S3, RDS, log groups, Lambda, DynamoDB, ECR, Route 53) and Cloudflare (zones, R2, Workers, Pages) join DigitalOcean and Hetzner. AWS's bill by service and region comes from Cost Explorer, asked for once a UTC day, ten pages at most ($0.01 each). What could not be read is kept with its reason and its old rows stay.

Safety

  • Reads only. One signer; hosts come from a fixed table and a checked region; redirects and any operation not named Describe, List or Get are refused.
  • forge.json gains three exact AWS hosts and no wildcard.
  • A fresh review found a quadratic XML parse (a 400 KB malformed answer held the forge 106 s). It is now a linear scanner over a capped body, with tests.
  • A page draw reads the database only. With 2,000 resources the tree phase took 4 to 15 ms here.

Costs are the bill, list price, or marked as having none. A bill is never added to the prices it covers. The bill is before credits and refunds.

Tests: 48 targeted files pass, tsc and the gate are clean. The full suite has not run locally; this check is its first run.

Unproven: no live AWS or Cloudflare account has been read. AWS resources have no list price yet (next pull). GovCloud, China, EKS, ECS, EFS, ElastiCache and bucket sizes are not read.

Replaces: the Projects section of /infra and the project rows of the terminal's Infra Replaces: the Build form beside the tree, and the words billed, list and unknown on every row

[
  {"go":"/infra","look":"main","expect":"Infrastructure opens on the resources and what they cost, or says no cloud account is attached and links to Cloud accounts. No Build form is on this page."},
  {"go":"/infra?q=kind:volume%20attached:no","look":"main","expect":"The filter box holds the query. The heading says how many unused volumes there are, or that nothing matches."},
  {"go":"/infra/build","look":"main","expect":"The Build form has its own page, with a way back to Infrastructure."}
]

🤖 Generated with Claude Code

commented

On sentinel's review, at 2722373:

  • forge.json, the high finding: nothing the code calls was removed. api.cloudflare.com, api.osv.dev and www.cisa.gov were each listed twice on main, and each is still listed once here. The duplicates cannot go back beside the three AWS hosts: that makes 34 entries, and EGRESS_MAX is 32.
  • quiet-debt.json is as main has it; the tree uses the named row list.
  • docs/CLOUD.md is wrapped.
  • The part the review did not reach (tree.ts, the pages, the terminal, the tool) was reread by its author. Fixed: a filter cut inside an emoji answered 500, and kind:constructor printed JavaScript. HTML escaping and the admin-only routes and tool are tested. Please read those files too: they were cut from the diff the first time.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs