Chapter 1 kept files in S3. Servers need storage too, and AWS offers three kinds that behave differently.
| Kind | Service | What it is | Used by |
|---|---|---|---|
| object | S3 | files fetched by key over HTTP, from anywhere | websites, backups, exports, anything shared by URL |
| block | EBS | a disk: a raw device you format and mount | one instance, in one zone |
| file | EFS | a shared folder, mounted over the network | many instances, in many zones |
Some instance types also have instance store: a disk inside the host machine. It is fast, and it is wiped when the instance stops or moves. Use it only for data you can lose, such as a cache.
You already have a volume
Every instance boots from an EBS volume, its root volume, made from the image at launch. That is why a stopped instance keeps its files: the disk is EBS, separate from the machine.
aws ec2 describe-volumes --query "Volumes[].[VolumeId,Size,VolumeType,State]" --output tableEach running instance shows up here as an 8 GiB gp3 volume in-use. Volumes are billed per gigabyte per month whether full or empty, attached or not.
This chapter goes deeper into S3 first (versions, cheaper storage, archives, sharing, copies in another region), then gives the market's server a data disk of its own and a shared folder.