Skip to main content

Command Palette

Search for a command to run...

S3 Object Versioning & MFA Delete

Updated
3 min read
S3 Object Versioning & MFA Delete

Object versioning is a feature which can be enabled on an S3 bucket - allowing the bucket to store multiple versions of objects

These objects can be referenced by their version ID to interact directly - or omit this to reference the latest version of an object

Objects aren't deleted - object deletion markers are put in place to hide objects.

Versioning is an essential feature to understand for the exam.

MFA Delete is a related feature which is also discussed.

Obj Versioning is controlled at bucket level.

Bucket at disabled state. But once the feature is enabled, it can’t be disabled again.

If needed the bucket can be suspended and can be re-enabled

Without versioning enabled, each obj. is identified using object key. ( that is, obj. name)

If you modify an obj. the original version of that document is replaced.

Versioning lets you store multiple versions of the object in a bucket.

When an object is modified by some operation, a new version is generated and it replaces the old one.

There is an attribute of the obj. known as ID. When versioning is disabled, the ID of the obj. is set to null. That’s the meaning of the versioning being off on a bucket – all objects will have id of null.

If versioning is enabled and new obj is added, then that obj. is given an ID e.g 11111

If any modifications are made to this object, the new version is given a new id and retains old version The newest or latest version is known as current version.

If an object is accessed without specifying the id then the current version is returned.

Versioning also affects deletions. If we indicate to S3 that we want to delete an object and not specify the version id then S3 adds a new special. version of the obj. known as delete marker.

The delete marker makes the obj look deleted but actually the obj is hidden.

So delete marker is a special version which hides all previous versions of the obj.

If delete marker is deleted then essentially undeletes the object making current version active again.

If an object is requested to be deleted by specifying the version id then the version is deleted.

If the current version is deleted, then the previous version becomes current ver.

Imp points to remember.

Once the versioning feature is enabled on a bucket, it cannot be disabled only suspended.

If versioning is enabled, then we have to pay the storage costs for all those versions.

If versioning is suspended, the above. point holds good

MFA delete

  • It is enabled in the versioning configuration of bucket

  • When enabled, MFA is required to change versioning state from enabled to suspended or vice-versa

  • To delete versions also, MFA is required.

  • How is it done – (Serial number of MFA with Code passed with the API calls)