People make mistakes: they upload the wrong file, or delete the right one. Versioning keeps every old copy, so you can undo it.
menu.html v1Monday
overwritten
menu.html v2Tuesday
overwritten by mistake
menu.html v3Wednesday, latest
Visitors get the latest version. The older ones stay in the bucket, each with its own version id. Every version takes space, and S3 bills for the space you use. Versioning is off on a new bucket.
New command
aws s3api put-bucket-versioning
Turns versioning on for a bucket. s3api is the full set of S3 commands; s3 is the short, friendly set.
Usageaws s3api put-bucket-versioning --bucket bucket --versioning-configuration Status=Enabled
Example
aws s3api put-bucket-versioning --bucket dragon-photos-2026 --versioning-configuration Status=Enabled
Each upload now adds a version instead of replacing the object. The next lesson shows how to find an old version and bring it back.