Skip to main content
In this lesson you’ll learn how Amazon S3 versioning behaves when it’s Disabled, Enabled, and Suspended. We’ll walk through creating a bucket, uploading objects with the same key, deleting objects, and observing delete markers and Version IDs so you understand how to recover or permanently remove versions. Before you begin, create a new S3 bucket and leave versioning set to Disabled so you can observe non-versioned behavior first.
A screenshot of the AWS S3 console showing the "Block all public access" settings with multiple checked options and an "Upcoming permission changes" notice. Below that is a "Bucket Versioning" section with radio buttons for Disable and Enable.
Prerequisites:
  • An AWS account with S3 access.
  • Basic familiarity with uploading files through the S3 console.
  1. Upload a simple object to the bucket
Create a local file called file1.txt containing:
Upload file1.txt to the bucket using the S3 console (use default upload options). After the upload completes, open the object to confirm it contains “this is version 1”.
A screenshot of the Amazon S3 web console Upload page. It shows one file (file1.txt) queued for upload to the kk-versioning-demo bucket with an orange "Upload" button.
  1. Behavior when versioning is disabled
With versioning disabled, S3 treats objects like a simple key/value store. Deleting an object while versioning is disabled permanently removes the object and its data — there are no stored versions to roll back to. If you delete the object in this state, the console will require explicit confirmation for permanent deletion:
Screenshot of the Amazon S3 "Delete objects" page showing one listed file (file1.txt) and a confirmation textbox where the user has typed "permanently" to confirm deletion. The page displays a warning that deleting the specified objects cannot be undone.
Key point:
  • Re-uploading the same key after deletion creates a new object that overwrites the (now deleted) key — there is no version history.
  1. Enable versioning on the bucket
Now enable versioning from the bucket Properties → Bucket Versioning → Edit → Enable. After saving, the bucket will be in the versioning-enabled state. Upload file1.txt again (with the same contents as before). The console view initially looks familiar, but you will now have a “Show versions” toggle available. Turning on Show versions reveals Version ID and other per-version metadata for each object.
  1. Upload new versions of the same key
Create an updated local file for version 2:
Upload it using the same key (file1.txt). With versioning enabled, S3 does not discard the previous data — it stores a new version and assigns a unique Version ID. Use the console’s “Show versions” toggle to list past and current versions. Repeat to create version 3:
Upload again. You will then have multiple versions for the same key; the most recent upload is the current version shown by default (when Show versions is off), but all older versions are preserved and accessible when Show versions is enabled.
  1. Deleting objects when versioning is enabled — delete markers
When you delete an object while versioning is enabled, S3 places a delete marker as the current version instead of permanently removing prior versions. The delete marker hides earlier versions from the normal object listing until you enable Show versions. When you delete the object in this state, the console will show a successful deletion status (it has added a delete marker):
A screenshot of the AWS S3 console showing the "Delete objects: status" page with a green banner that says objects were successfully deleted. The summary indicates 1 object (17.0 B) was deleted from the bucket s3://kk-versioning-demo and 0 objects failed to delete.
If you enable Show versions, you will see the delete marker along with prior versions:
Screenshot of the Amazon S3 console for the bucket "kk-versioning-demo" showing the Objects tab with multiple versions of file1.txt (one listed as a delete marker), version IDs, timestamps, sizes and storage class. The "Show versions" toggle is enabled and the actions/upload toolbar is visible.
To restore visibility of the previous version, delete the delete marker (the delete marker itself is a versioned object). Removing the delete marker makes the latest non-delete version visible again.
  1. Permanently deleting a specific version
If you explicitly delete a specific version by selecting its Version ID, S3 permanently removes that version with no delete marker created. This action is irreversible for that version. When performing a version-specific delete in the console you’ll be prompted to confirm permanent deletion. After confirmation, that particular version is removed from the bucket’s history.
  1. Suspending versioning (you cannot fully disable a previously enabled state)
Once a bucket has had versioning enabled, you cannot fully revert it to a “never enabled” state — you can only Suspend versioning. Suspending stops creation of new versioned objects, but all prior versions and their Version IDs remain in the bucket. Go to Properties → Bucket Versioning → Edit → Suspend. The console displays a warning about impacted functionality; acknowledge and save changes.
A screenshot of the AWS S3 "Edit Bucket Versioning" console, showing options to suspend or enable bucket versioning with a warning about impacted functionalities and a "Save changes" button.
Suspending versioning does not remove or alter existing versions. It only changes how new uploads are stored going forward.
After suspending versioning, prior versions remain accessible. New uploads of the same key will be stored with a Version ID of null and will behave like non-versioned objects: subsequent uploads to that key will overwrite the null version in place, while earlier versioned objects remain preserved. Example: create version 4 and version 5 locally:
Upload them after suspending versioning — the console will show the latest object as Version ID null. Older versioned objects retain their original Version IDs and remain accessible when Show versions is enabled.
  1. New keys while versioning is suspended
If you upload a new key (for example, file2.txt) when versioning is suspended:
  • The new key is stored with a Version ID of null.
  • Subsequent uploads to file2.txt overwrite the null version in place.
  1. MFA Delete (additional protection)
S3 supports MFA Delete for additional protection. MFA Delete requires an MFA token to change the versioning state or to permanently delete versioned objects. Important: you can only enable MFA Delete via the AWS CLI or SDK — the S3 console cannot enable MFA Delete. See AWS docs for the exact CLI/SDK commands:
MFA Delete requires the AWS CLI or an SDK to enable. It adds an extra layer of protection for versioning changes and permanent deletions.
Screenshot of the AWS S3 console showing the "Edit Bucket Versioning" page. The "Suspend" option is selected, MFA delete is disabled, and there are Cancel and Save changes buttons.
Cleanup To remove everything:
  1. Enable Show versions in the console.
  2. Delete all versions and delete markers for each key.
  3. Delete the bucket.
Summary (quick reference) Links and References End of demo — now you should understand S3 delete markers, Version IDs, suspending versioning, and how MFA Delete adds protection.

Watch Video