What Happens to EC2 Compute and Storage Charges When Stopped?
When you stop an On-Demand Amazon EC2 instance, Amazon Web Services immediately stops billing you for the hourly or per-second compute capacity of that virtual server. However, any persistent storage attached to the instance, specifically Amazon Elastic Block Store volumes, continues to incur standard monthly provisioning charges so that your data remains available when you restart the machine.
How Compute Billing Changes When an Instance Stops
An On-Demand EC2 instance transitions through several lifecycle states before it reaches the stopped state. While the instance is in the running state, you are billed for compute capacity by the second (with a 60-second minimum for Linux instances) or by the hour, depending on the operating system and licensing model.
The moment you initiate a stop action and the instance enters the stopping state to prepare for shutdown, AWS ceases billing for On-Demand compute usage. Once the instance reaches the stopped state, it is detached from the underlying physical host hardware, and your compute charges remain at zero until you start the instance again.
It is important to note the difference between stopping an instance and rebooting an instance:
- Stopping and starting an instance moves it to a new underlying physical host, releases its public IPv4 address (unless using an Elastic IP), and pauses compute billing while stopped.
- Rebooting an instance keeps it on the same physical host, retains all network addresses, and keeps the instance in the running billing state continuously.
Why Attached Storage Charges Continue
To stop an EC2 instance, the instance must use an Amazon EBS volume as its root device. Unlike ephemeral instance store volumes, which are physically attached to the host server and lose all data when an instance stops, EBS volumes are network-attached block storage devices that persist independently of the compute lifecycle.
Because AWS continues to reserve and maintain your provisioned storage blocks on the storage Area Network while the instance is powered off, you continue to pay for:
- The total provisioned gigabytes of all attached EBS volumes (such as gp3, gp2, io1, io2, st1, or sc1).
- Any extra provisioned IOPS or throughput configured beyond the baseline on volumes like gp3, io1, or io2.
- Any EBS snapshots stored in Amazon S3 that were created from those volumes.
If we denote the hourly compute rate as \(R_{c}\), the active running hours in a month as \(H\), the monthly storage rate per gigabyte as \(R_{s}\), and the provisioned storage size in gigabytes as \(S\), the total monthly cost \(C_{total}\) of an instance that is stopped for part of the month can be expressed as:
\[C_{total} = (R_{c} \times H) + (R_{s} \times S)\]
Even if the running hours \(H = 0\) for the entire month because the instance remains stopped, the storage cost component \((R_{s} \times S)\) still applies in full.
Instance Store Volumes vs. EBS Volumes
Some EC2 instance families include local NVMe or SSD instance store volumes. The cost of instance store storage is bundled directly into the On-Demand compute price of the instance. When you stop an EBS-backed instance that also has attached instance store volumes, two things happen:
- You are not billed separately for the instance store volumes while stopped.
- All data on the instance store volumes is permanently erased because the virtual machine is deallocated from the physical host where those drives reside.
Other Associated Costs to Watch While Stopped
Beyond attached EBS volumes, stopping an EC2 instance can affect or leave active several other related charges on your AWS bill:
- Elastic IP Addresses: AWS does not charge for one Elastic IP address associated with a running instance, or verify charges the same way across all address types, though as of recent AWS pricing updates, all public IPv4 addresses (whether in-use or idle Elastic IPs) incur a small hourly charge.
- EC2 Instance Hibernate: If you hibernate an instance instead of performing a standard stop, the contents of the instance memory (RAM) are written to the root EBS volume. While compute charges stop during hibernation, you must have enough extra space on your root EBS volume to store the RAM dump, which increases your ongoing EBS storage cost.
- Capacity Reservations: If you have an active On-Demand Capacity Reservation targeting the instance's attributes, you continue to pay for the reserved capacity slot even while the instance itself is stopped.
How to Eliminate Both Compute and Storage Charges
If you no longer need the EC2 instance or the data on its attached drives, stopping the instance is not enough to eliminate your bill. To stop both compute and storage charges:
- Back up any needed data by creating an Amazon EBS snapshot or copying files to Amazon S3 (note that snapshots and S3 storage incur their own lower per-gigabyte storage rates).
- Terminate the EC2 instance rather than stopping it.
- Verify whether the Delete on Termination attribute is enabled for all attached EBS volumes. By default, the root EBS volume is deleted automatically upon termination, while additional attached data volumes remain provisioned and billable until you manually delete them from the EC2 console.