Skip to main content

AWS S3: VERSIONING

Versioning is an important feature provided by s3.We can enable versioning while creating an s3 bucket.For that from aws dashboard > S3 > Create bucket


On first section appears give name of the bucket.The name should be globally unique.Also specify region.Then click next.On the next step activate the properties we want.As we want to enable versioning enable that and click next.On next window we have to set permissions.Here under manage
public permissions give public read access to bucket and then click next and create bucket.









We can see our bucket is created.Now we want to upload a file to bucket.Open notepad and make a sample file and save it.Now go inside or bucket and upload it.
This is my sample file.Now to upload it go inside the bucket and click upload. Click on add files and select the file we saved earlier and click next.No we want to set permissions for that. Select grant public read access to the object under manage public permissions.Now click next.Here we want to select properties we want.Here we can select the storage class. We will go with standard one.Also we can set different features like encryption,metadata etc here.Here we are not going with any other options and so click next and select upload.








Now click on our file and click the dns url aws provided.We can see our fille gets opened up.

 When we click on latest versions we can see that only one version is available.Now open the file we created and add some more contents and save it.



Now go to our bucket and upload it as we uploaded earlier.We can see the size of our file is increased to 40kb.Now access its dns url.We can see other page appears since we updated that file.Just click on latest versions and we can see that two versions of file are present.


An important feature of versioning is that we can retrive the object if we deleted it.We can check that.For that just delete the file we uploaded.

Now we can see that nothing is present.Now just click on show near to versions.We can see list of various versions. A delete marker will be present in it as we deleted the object. In order to get that file back just delete that delete marker.We can see the file appears back.This is an important feature of versioning.


It is important to note that if we delete a version its lost,but if we delete an object we can restore it.Versioning will stores all versions of an object including all writes and even if we delete an object.Once versioning  is enabled versioning can't be disabled.It can only be suspended.