Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help


title: “S3 Versioning” created: 2026-07-20 updated: 2026-07-20 type: knowledge tags:

  • aws
  • s3
  • storage
  • versioning
  • certification

S3 Versioning

What It Is

A bucket-level feature that keeps multiple variants of an object in the same bucket. Every upload of an object with the same key creates a new version rather than overwriting.

Why It Matters

Versioning protects against accidental deletion and overwrites. It is critical for compliance, auditing, and disaster recovery scenarios — all frequent exam topics.

Key Concepts

States

StateBehavior
Unversioned (default)No version tracking; overwrites and deletes are permanent
EnabledAll objects get a unique Version ID; deletions create delete markers
SuspendedStops creating new versions but preserves existing ones

How Versions Work

  • Each upload generates a new Version ID
  • GET without specifying a version always returns the latest version
  • Objects uploaded before versioning was enabled have Version ID = null

Delete Behavior

  • Simple delete (without version ID): inserts a Delete Marker — the object appears deleted but all previous versions remain
  • Permanent delete (specify version ID): removes that specific version permanently; no delete marker created
  • Restoring: delete the delete marker → object reappears with its latest real version

Accessing Older Versions

  • Via Console: toggle “Show versions” → select the version
  • Via API/CLI: specify versionId parameter
  • Requires s3:GetObjectVersion permission (separate from s3:GetObject)

Gotchas

  • Versioning cannot be disabled once enabled — only suspended
  • Every version is a full copy (not a diff) → storage costs multiply
  • Delete markers are lightweight objects but still count
  • MFA Delete can be enabled to require MFA for permanent version deletions

See Also

  • [[s3-fundamentals]]
  • [[s3-object-operations]]
  • [[s3-bucket-policies]]