Support Portal
costlensstopped ec2

Stopped EC2 Instances

CostLens flags EC2 instances stopped for more than 7 days where EBS storage charges continue.

Last updated: May 2025

A stopped EC2 instance doesn't bill for compute time — but its attached EBS volumes continue to accrue storage charges. CostLens flags instances stopped for more than 7 days where the EBS cost is significant enough to warrant review.

Permanent action — you must take your own backup first

Applying this fix permanently terminates the instance and deletes all attached EBS volumes. CostLens does not create any automatic backup. You are responsible for taking a snapshot or AMI before proceeding. Once terminated, the data cannot be recovered through CostLens.

How it works

CostLens lists stopped instances

Lists all EC2 instances with state stopped.

Estimates time stopped

Checks CloudWatch CPUUtilization SampleCount to estimate when the instance was last stopped.

Flags instances stopped 7+ days

Calculates total monthly EBS cost from the sum of all attached volumes.

Confirmation dialog with backup instructions

When you click Apply Fix, CostLens shows a confirmation dialog with backup instructions and two required acknowledgement checkboxes.

Terminates the instance

Once both checkboxes are checked and you confirm, CostLens calls ec2:TerminateInstances. AWS then deletes all attached EBS volumes automatically.

Before you approve — checklist

  • Create an AMI or per-volume EBS snapshot if the instance data may be needed
  • Check if the instance is stopped intentionally (maintenance window, seasonal usage, waiting for deployment)
  • Verify no critical data is stored exclusively on attached EBS volumes (databases, logs, application data)
  • Check for Elastic IPs assigned to the stopped instance — these will be released when the instance terminates

Severity levels

SeverityEBS cost
critical≥ $50/mo — high-value idle resource
high$20–$50/mo
medium$5–$20/mo
low<$5/mo — minor cleanup

How to create a backup

Go to EC2 → Instances → Actions → Image and templates → Create image. This creates an AMI that captures the full root volume and instance config. Per-volume EBS snapshots can be created separately from EC2 → Elastic Block Store → Snapshots.

Previous
Idle Load Balancer
Next
Unused EBS Volumes