You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Versioning protects your data from accidental overwrites and deletions. Lifecycle policies automate the transition of objects between storage classes and their eventual expiration. Together, they form the backbone of a cost-effective and resilient storage strategy.
When versioning is enabled on a bucket, S3 keeps every version of every object. Each PUT generates a new version with a unique version ID. Deleting an object does not actually remove the data — it inserts a delete marker, which hides the current version but preserves all previous ones.
A bucket can be in one of three versioning states:
| State | Description |
|---|---|
| Unversioned | The default. No version tracking. Overwrites and deletes are permanent. |
| Enabled | Every object gets a version ID. All versions are preserved. |
| Suspended | New objects get a null version ID, but existing versions are preserved. |
Once versioning is enabled, it can be suspended but never fully disabled.
aws s3api put-bucket-versioning \
--bucket my-app-bucket \
--versioning-configuration Status=Enabled
Uploading the same key twice:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.