ReviewOS

stacks/ts-cloud

Implement `optimize` — opinionated cost-saving recommendations

#112
Closed glennmichael123 opened this 2 months ago ·
2 months ago

Implementation issue split out from #107.

Replace the mock-data body in packages/ts-cloud/bin/commands/cost.ts (optimize command) with real implementation. Composes resources + resources:unused + cost:breakdown into actionable recommendations:

  • Reserved Instance candidates (steady-state EC2 / RDS workloads).
  • Right-sizing (EC2 / RDS instances < 20% utilization).
  • Storage class transitions (S3 Standard → Intelligent-Tiering / Glacier).
  • Unused resources (delete recommendation, sourced from `resources:unused`).
  • CloudFront compression / caching wins (data transfer cost).

Acceptance

  • cloud optimize returns real recommendations from the connected account.
  • Each recommendation lists current cost, projected cost, savings, and the source signal (which CloudWatch metric / Cost Explorer line item triggered it).
  • --profile honored.
  • Replaces the cli.warn('not implemented') guard introduced by #107.

Notes

  • This is the heaviest of the five — depends on resources and resources:unused being real first. Last to implement.
  • Some recommendations (RI commitments, Compute Savings Plans) need account-level commitment-tracking data; can stub those with a flag (--include-commitments) once the rest is real.
  • #107 — tactical guard
8 days ago

Roadmap relationship: tracked by #135 under master roadmap #132.

8 days ago

Implemented and pushed to main in 0e5c12d. cloud optimize now composes live resource inventory, provider/CloudWatch signals, CUR resource-level costs, and Cost Explorer CloudFront transfer line items into unused-resource, EC2/RDS right-sizing, S3 lifecycle, CDN cache/compression, and opt-in commitment recommendations. Every recommendation reports source signal plus current/projected/savings fields, --profile, --region, and --type are honored, and financial estimates are documented as directional. Added focused tests (10 optimizer cases; 18 related cost/resource tests), strict Pickier verification (779 files, 0 errors/warnings), and a successful 55-page build.

Sign in to comment on this issue.