Sub topic 16
Controlling EBS costs
This chapter assumes you can create, attach and snapshot volumes with the AWS CLI, and that you know the volume types from earlier chapters. Here you will see what EBS bills for and how to cut the waste.
What you pay for
EBS charges for what you provision, not for what you use. A 500 GiB volume that holds 10 GiB of data is billed for 500 GiB.
| Cost driver | When it applies |
|---|---|
| Provisioned storage (GiB-month) | Every volume, attached or not |
| Provisioned IOPS and throughput | io1/io2, and gp3 above its baseline |
| Snapshot storage | Stored snapshot data, billed by GiB-month |
| Fast snapshot restore | Each enabled snapshot and Availability Zone, per hour |
Check current prices for your Region on the EBS pricing page. They change and differ by Region.
Find unattached volumes
A volume in the available state is not attached to any instance, but it still bills. These often remain after an instance was terminated with DeleteOnTermination set to false on a data volume.
aws ec2 describe-volumes \
--filters Name=status,Values=available \
--query 'Volumes[].{Id:VolumeId,GiB:Size,Type:VolumeType,Created:CreateTime}' \
--output tableSnapshot a volume before you delete it if you might need the data. The snapshot costs less than the volume.
Move gp2 volumes to gp3
gp3 has a lower per-GiB price than gp2 and includes 3,000 IOPS and 125 MiB/s at any size. You can change the type in place with Elastic Volumes:
aws ec2 modify-volume \
--volume-id vol-0123456789abcdef0 \
--volume-type gp3A large gp2 volume may have had more than 3,000 IOPS from its size-based burst model. Check its recent peak IOPS in CloudWatch first. If it needs more, set --iops or --throughput explicitly on the same call.
Right-size what you provision
EBS cannot shrink a volume in place. To reduce size, create a smaller volume, copy the data across at the file level, and swap them. Plan this, because it is more work than growing a volume.
Use CloudWatch to judge performance settings. If VolumeReadOps and VolumeWriteOps stay far below the provisioned IOPS, you are paying for headroom you do not use. A volume with near-zero activity and a high VolumeIdleTime is a candidate for deletion.
Trim snapshots
Snapshots are incremental, so deleting one only frees blocks that no other snapshot needs. Old snapshots whose source volume is gone are the usual leftovers. List snapshots you own that predate a cutoff:
aws ec2 describe-snapshots \
--owner-ids self \
--query 'Snapshots[?StartTime<=`2026-01-01`].[SnapshotId,VolumeSize,StartTime]' \
--output tablePrevent the buildup with Data Lifecycle Manager or AWS Backup retention rules, as covered in the automation chapter. For snapshots you keep for compliance and rarely restore, move them to the archive tier:
aws ec2 modify-snapshot-tier \
--snapshot-id snap-0123456789abcdef0 \
--storage-tier archiveAlso review fast snapshot restore. It bills hourly per snapshot and Availability Zone, so disable it on snapshots that no longer need instant full performance.
Exercise
A team has 40 gp2 volumes, 6 volumes in the available state, and a nightly snapshot job with no retention rule. Name three actions that lower the bill, in the order you would do them.
Show answer
First, review and delete the 6 available volumes, taking a snapshot of any that may hold needed data. Second, add a retention rule (Data Lifecycle Manager or AWS Backup) so old snapshots expire, and delete the existing backlog. Third, convert the gp2 volumes to gp3 with modify-volume after checking in CloudWatch that none depends on gp2 performance above 3,000 IOPS.