AWS Certified Cloud Practitioner / Amazon S3

S3 Versioning Overview

πŸ—‚οΈ Amazon S3 Versioning

Safely update files without ever losing older copies. Once enabled, every new upload gets its own version automatically β€” essential for static websites, backups, and critical files.


❓ How It Works

  • Every file in a bucket has a key

  • First upload β†’ Version 1

  • Re-upload the same key β†’ Version 2, 3… πŸ”’

  • All previous versions stay safely retained πŸ›‘οΈ


πŸ€‘ Benefits

  • ❌ Protects against accidental deletes β€” deleting just adds a delete marker; old versions stay intact

  • βͺ Easy rollback β€” restore any previous version whenever needed

  • ⚠️ Safe suspension β€” suspending versioning doesn't delete existing versions

  • 🟒 Files uploaded before versioning was enabled show version null


πŸ“ Example

  • Upload index.html πŸ“„ β†’ Version 1

  • Update index.html ✏️ β†’ Version 2

  • Rollback β†’ Serve Version 1 πŸ”„


βœ… Best Practice

Versioning is essential for production buckets β€” it guarantees safety and quick recoverability.