Auto-Fix
Automatically apply safe, reversible recommendations as they're found — configured per check by an admin, with a savings cap, maintenance windows, dry-run mode, auto-categorised inclusion/exclusion lists, and 24-hour rollback.
Auto-Fix lets CostLens apply selected recommendations for you, automatically, as soon as they're found — so routine, low-risk waste is remediated without anyone clicking Approve. It is off by default, admin-managed, and deliberately limited to safe, reversible actions.
A good way to think about it: you tell CostLens "for these check types, anything small and routine — just fix it; leave the big, judgement-call changes for me."
Where to find it
Open Settings → Auto-Fix in the sidebar (/settings/automation). The page is only visible to organisation Admins.
Who can use it
| Role | Access |
|---|---|
| Admin | Full access — view and manage Auto-Fix rules |
| Operator / Viewer | No access — the page is hidden |
| Read-only organisations | Blocked — Auto-Fix cannot apply changes on a read-only plan |
How it works
- CostLens analyses your accounts on its regular schedule (and after a sync).
- For each new pending recommendation, it checks whether you've enabled an Auto-Fix rule for that check type.
- If the recommendation passes your rule's guardrails, CostLens either:
- Simulates it (dry-run) — no change is made, and you're notified to review; or
- Applies it — the same action as approving the fix yourself, attributed to the admin who configured the rule.
- Every action is written to your organisation's audit log and a notification is sent. Applied fixes remain roll-back-able for 24 hours.
Auto-Fix never runs more than a safety cap of fixes per account per analysis run, so a single run can't mass-apply unexpected changes.
Which recommendations are eligible
Auto-Fix only ever runs reversible or non-destructive remediations:
| Eligible check | What Auto-Fix does |
|---|---|
| EC2 Rightsizing | Resizes the instance to the recommended type |
| EBS gp2 → gp3 Migration | Migrates the volume type in place |
| EBS High Disk Usage | Expands the volume (and grows the filesystem) |
| EC2 Instance Scheduling | Applies the start/stop schedule |
| RDS Instance Scheduling | Applies the start/stop schedule |
| CloudWatch Log Retention | Sets a log-retention policy |
Actions that permanently delete or release resources are never eligible for Auto-Fix and must always be applied manually:
- Unused EBS Volume (delete)
- Orphaned EBS Snapshots (delete)
- Unattached Elastic IP (release)
- Stopped EC2 Instance (terminate)
Destructive actions stay manual
Anything that destroys data or releases a resource is excluded from Auto-Fix by design. These always require a human to review and approve in the Recommendations flow.
Configuring a rule
Each eligible check has its own card. Turn it on, then set the controls.
Quick setup (presets)
Not sure where to start? Use a one-click preset to fill the form with a safe baseline, then review and Save:
- Conservative — dry-run only (simulate, never change), small savings cap, longer observation window.
- Balanced — live apply with a moderate savings cap, an off-hours maintenance window, and a small per-run limit.
- Aggressive — live apply with no savings cap and a shorter observation window.
All presets keep production excluded by default. Presets just populate the controls — nothing is saved or applied until you click Save.
Auto-apply fixes saving up to ($/mo)
The single "how big a change" lever, in plain dollars: Auto-Fix will only auto-apply a fix whose estimated monthly savings is at or below this amount — bigger fixes are left in the Recommendations list for you to review. Leave it blank to allow any size. (Larger savings generally mean larger changes, so this one number caps the blast radius.)
Maintenance window (UTC)
Restrict live changes to a safe window: pick the days of the week (e.g. Sun, Sat) and a start/end hour in UTC. Outside the window, eligible fixes are deferred to the next run inside it. Simulations (dry-run) still run any time. Leave days unselected to mean "every day".
Dry-run only
When on (the default for new rules), Auto-Fix simulates the fix and notifies you — it never changes anything in AWS. Turn it off to let Auto-Fix make real changes. Start with dry-run to see exactly what would happen before going live.
EBS expand increment (EBS High Disk Usage only)
How much to grow the volume — the default (+20%), a custom percent, or a fixed number of GB.
Plain-English summary
As you change the controls, each card shows a one-line summary of exactly what the rule will do — for example: "Will automatically apply EBS High Disk Usage for fixes saving up to $200/mo. Bigger fixes are left for you to review and approve. Safeguards: only during Sat/Sun 01:00–05:00 UTC; production auto-excluded."
Knowing what's in scope — Inclusion & Exclusion lists
You don't have to enable a rule to see what it would affect. Each rule card has a Detected resources panel that scans your current findings and auto-sorts every matching resource into two lists:
- Inclusion — resources that would be auto-fixed. Each row shows the savings and the exact decision (would apply / would simulate / skipped — reason, e.g. above $/mo cap, risk guard, outside maintenance window).
- Exclusion — resources held back. Production-tagged resources land here automatically (with a prod badge).
You stay in control: move any resource between the lists with one click — Include a production resource to auto-fix it, or Exclude a non-production one to protect it. Moves persist immediately to the rule's inclusion/exclusion lists (and a reset link reverts a resource to its automatic category). Manual ID lists are also available under Advanced safeguards for resources you want to pin without waiting for them to be detected.
The panel spans all of your connected AWS accounts and lists every auto-fixable category — including those with 0 matching findings right now (empty simply means the analysis hasn't produced pending recommendations of that type yet, not a scoping limit). It reflects your saved settings and refreshes after each change. After runs, the same actions appear in Fix History and notifications.
Setting it up
Open Settings → Auto-Fix
As an admin, go to Settings → Auto-Fix in the sidebar.
Enable a check
Toggle on the check you want to automate (e.g. EBS High Disk Usage).
Set your guardrails
Optionally set the savings cap ("auto-apply fixes saving up to $X/mo"), a maintenance window, and any check-specific options (e.g. EBS expand increment). Production resources are excluded automatically.
Start in dry-run
Leave Dry-run only on. Save. CostLens will simulate matching fixes and notify you so you can confirm the behaviour is what you expect.
Review what's in scope
Open the Detected resources panel to see the Inclusion / Exclusion lists. Move any resource between them (Include / Exclude / Reset) until the scope is exactly what you want.
Go live
Once you're comfortable, turn Dry-run only off and save. CostLens will now apply matching fixes automatically.
Safety, audit & rollback
- Reversible-only: Auto-Fix is restricted to a fixed allowlist of safe remediations; destructive actions are never automated.
- Guardrails: a per-fix savings cap bounds how large a change Auto-Fix can make unattended, and production resources are auto-excluded by default.
- Dry-run default: new rules simulate until you explicitly enable live apply.
- 24-hour rollback: auto-applied fixes can be undone from Fix History within 24 hours, exactly like manually applied fixes.
- Automatic rollback on regression: for EC2 right-sizing, CostLens watches the instance after the change and reverts automatically if it degrades (see below).
- Audit trail: every rule change and every auto-applied fix is recorded in your organisation's audit log (look for Fix Auto-Applied and Auto-Fix Rule entries).
- Notifications: admins are notified each time Auto-Fix applies or simulates fixes on an account.
Safeguards for right-sizing & scaling
Beyond the core controls, Auto-Fix applies a set of safeguards to every eligible check (EC2, RDS scheduling, EBS, CloudWatch, …) — not just one resource type. Configure them under Advanced safeguards on each rule.
- Decision-time data rigor — set a minimum observation window (e.g. 14–30 days) so Auto-Fix never acts on a short-lived spike or dip. Utilization-driven checks should be judged on peak/p95/p99, not just averages.
- Dependency & risk guards — Auto-Fix automatically skips changes that could break interconnected systems: EC2 instances in an Auto Scaling Group (resize the launch template instead), cross-architecture resizes (Intel ↔ Graviton/ARM), CPU-only signals where memory metrics are missing, and (for any future RDS class change) non-Multi-AZ instances or those with read replicas.
- Production excluded by default — resources detected as production (by
Environment/envtag, anenvironmentofprod/production, or aprodin the name) are automatically left out of Auto-Fix. They show as "skipped — production" in the preview. To auto-fix a specific production resource, add its ID to the inclusion list; to allow all production resources for a rule, turn on Allow production. - Inclusion & exclusion lists — detected resources are auto-sorted into these two lists (production → Exclusion); move any resource between them from the Detected resources panel, or pin IDs manually under Advanced safeguards. The inclusion list opts a resource back in (overriding the production default); the exclusion list opts it out permanently (and always wins).
- Tag-based scoping — instead of listing individual IDs, scope by AWS tag: Exclude by tag (e.g.
team=payments, or a baretemporary) hard-excludes any matching resource; Include by tag (e.g.tier=batch) opts matching resources back in over the production default. Precedence: ID-exclude → ID-include → tag-exclude → production default (liftable by include-tag or Allow production). - Maintenance window — restrict live changes to off-hours (UTC); simulations still run any time.
- Staged rollout — cap fixes per run so changes roll out gradually rather than all at once.
- Backup awareness — for stateful changes, take your own snapshot/backup first; CostLens shows the warning and never assumes responsibility for your data.
Post-change auto-rollback
For EC2 right-sizing, CostLens watches the instance's health for ~6 hours after the change and automatically rolls it back if CPU stays saturated — then notifies you. This closed-loop safety net (on by default; toggle under Advanced safeguards) is what makes hands-off Auto-Fix safe to trust. You also retain the 24-hour manual rollback in Fix History.
EC2 / RDS right-sizing specifics
EC2 right-sizing keeps the same CPU architecture, skips Auto Scaling Group members, and won't downsize on CPU alone when memory data is unavailable. RDS instance-class downsizing is not auto-applied today — it requires a reboot (downtime) unless Multi-AZ and must be snapshot-first; only RDS scheduling is eligible.
Where to see results
- Impact summary — at the top of the Auto-Fix page: realised monthly savings attributable to Auto-Fix, fixes applied, simulations, rollbacks (including automatic ones), success rate, and estimated analyst-hours saved.
- Fix History (
/fixes) — every auto-applied fix appears here with its before/after state and a Rollback button while it's within the 24-hour window. - Notifications — a summary is sent after each run that applies or simulates fixes, and whenever a change is auto-rolled-back.
- Audit Log — rule changes, auto-applied fixes, and auto-rollbacks are recorded for compliance.
Recommended rollout
Enable one low-risk check first (for example EBS gp2 → gp3 Migration or CloudWatch Log Retention) in dry-run, review the simulated results for a cycle or two, then switch to live apply and expand from there.