Lesson 3 of 3 AWS Backup and Data Versioning

Protecting S3 and FSx Data with Versioning, Object Lock and Replication

This lesson explains how versioning, which the exam guide names for S3 and FSx, protects against overwrites and deletions by keeping earlier copies of data.

Learning outcomes

After completing this lesson, you will be able to:

  • Enable and use S3 Versioning.
  • Use Object Lock and replication.
  • Use FSx file-level versions.
  • Recover from ransomware-style overwrites.

S3 Versioning

A bucket is unversioned until versioning is enabled; after that it can be suspended but never returned to unversioned. With versioning enabled, every PUT creates a new version with its own version ID, and a DELETE without a version ID creates a delete marker that becomes the current version, so the object appears deleted but all versions remain. Removing the delete marker restores the object; deleting a specific version ID removes that version permanently. Each version is billed as a separate object, so lifecycle rules should expire noncurrent versions after a period, optionally keeping a set number of newer noncurrent versions. MFA delete, which can be enabled only by the root user with the CLI, requires MFA to change the versioning state or permanently delete versions.

aws s3api put-bucket-versioning --bucket acme-docs --versioning-configuration Status=Enabled
aws s3api list-object-versions --bucket acme-docs --prefix contracts/2026/q3.pdf
# restore an object by deleting its delete marker
aws s3api delete-object --bucket acme-docs --key contracts/2026/q3.pdf --version-id <delete-marker-version-id>

The following diagram shows a versioned object after a malicious overwrite.

S3 versioning after a ransomware-style overwrite. Every PUT creates a new version, so the encrypted overwrite becomes the current version while the good version remains. A DELETE without a version ID adds a delete marker. Restoring means copying the last good version back, or removing the marker; lifecycle rules expire noncurrent versions.
The versions and period are illustrative.

Object Lock and replication

S3 Object Lock stores objects using a WORM model on versioned buckets. A retention period in governance mode can be overridden by users with s3:BypassGovernanceRetention; in compliance mode no one, including the root user, can delete the version or shorten retention. A legal hold prevents deletion indefinitely until removed. S3 Replication, which requires versioning on both buckets, copies new objects to another bucket in the same Region (SRR) or another Region (CRR), optionally to another account with ownership change, and can replicate delete markers. Existing objects are replicated with S3 Batch Replication. Replication Time Control replicates 99.99% of objects within 15 minutes with metrics and notifications.

99.99%

Objects replicated within 15 minutes with Replication Time Control

Sort into groups

Which protection?

Exam skills 2.3.3 · 2.3.1

Choose the S3 feature that meets each protection requirement.

Log in to try this activity Interactive activities are free with an account.

FSx versioning

FSx file systems provide file-level versions in addition to whole file system backups. The following table compares the versioning options across storage services.

ServiceVersioning featureHow users restore
S3Bucket versioning (with lifecycle and MFA delete)Remove delete marker or copy an earlier version
FSx for Windows File ServerWindows shadow copies on a schedulePrevious Versions tab in Windows Explorer
FSx for NetApp ONTAPVolume snapshots with snapshot policiesCopy files from the .snapshot directory
EFSNo file versioning; AWS Backup for point-in-time copiesRestore files from a recovery point

Shadow copies for FSx for Windows File Server are enabled with the Windows Set-FsxShadowStorage and Set-FsxShadowCopySchedule commands through the file system's remote PowerShell endpoint, and use part of the file system's storage.

Worked example

Ransomware-style overwrites

A compromised application credential overwrote thousands of objects in a bucket with encrypted garbage and deleted others. Because versioning was enabled, the team lists the versions for the affected period, uses S3 Batch Operations to copy the last good version of each overwritten object back as the current version, and deletes the delete markers for deleted objects. Afterwards they enable Object Lock in governance mode with a 30-day default retention on a new bucket for critical data and replicate it to a bucket in a separate backup account.

Check yourself

Can S3 versioning be turned off once it is enabled?

Show answer

No. It can only be suspended.

Exam Tips

Remember for the exam

  • Versioning, once enabled, can only be suspended; deletes create delete markers.
  • Expire noncurrent versions with lifecycle rules to control cost.
  • Object Lock compliance mode: nobody can delete before retention ends.
  • Replication needs versioning on source and destination; Batch Replication handles existing objects.
  • FSx for Windows shadow copies and FSx for ONTAP snapshots provide user-restorable file versions.