‫So, now let's talk about versioning
‫in Amazon S3.
‫Because we've seen how to create a website,
‫but it would be nice to be able to update it in a safe way.
‫So, you can version your files in Amazon S3,
‫and this is a setting you have to enable
‫at the bucket level.
‫So, we have my bucket and it's enabled with versioning.
‫So, whenever a user uploads a file,
‫it's going to create a version of that file
‫at the selected key.
‫And then should we re-upload the same key,
‫should we overwrite that file,
‫then instead it's going to create a version two,
‫and then a version three, and so on.
‫So, therefore, it is best practice to version your buckets.
‫Why?
‫Well, the first thing is that it protects
‫against unintended deletes.
‫So, for example, if you delete a file version,
‫actually you just add a delete marker
‫and therefore you can restore versions
‫that were previously there instead.
‫You can also easily roll back to a previous version.
‫So, if you want to go back to what happened two days ago,
‫you can take a file and roll it back.
‫So, there are some notes you need to be aware of.
‫First of all, that any file that is not versioned
‫prior to enabling versioning will have the version null.
‫And also that if you suspend versioning,
‫it does not delete the previous version,
‫so, it's a safe operation.
‫Okay, so now let's go into the console
‫and have a look at how we can use versioning.