Versioning in Amazon S3 is a means of keeping multiple variants of an object in the same bucket.
You can use the S3 Versioning feature to preserve, retrieve, and restore every version of every object stored in your buckets.
With versioning you can recover more easily from both unintended user actions and application failures, Versioning-enabled buckets can help you recover objects from accidental deletion or overwrite
After versioning is enabled for a bucket, if Amazon S3 receives multiple write requests for the same object simultaneously, it stores all of those objects.
Enable Bucket Versioning feature
In the S3 bucket interface, select bucket name aws-first-cloud-journey
Select Properties, in Bucket Versioning, select Edit
Change the content on the file index.html
Open the window containing the folders, files downloaded and extracted in lab 2.2
Select file index.html -> right click -> select Open with -> select Notepad
Scroll down to the middle of the page, at tag body, replace the value AWS First Cloud Journey with something else, for example: LEARNING CLOUD ^^ LEARNING FUN <3
Before editing:
Test versioning feature on S3
At the S3 bucket interface AWS First Cloud Journey, select Upload
Upload the newly edited index.html file into the AWS First Cloud Journey bucket by dragging and dropping
index.html
and press enter. You will see that the bucket only displays one object. Move the circle button of Show versions from left to right to see the version of the file.Test versioning feature on Cloudfront
So let’s see if the Default root object with the file index.html
has just been uploaded to a lasted version on S3, will the content change corresponding to step 2 above?
Open the Amazon CloudFront console at https://console.aws.amazon.com/cloudfront/home
Select current Distributions ID
1
1
However, at this time, if you want to quickly restore the old content without having to edit the index.html file on your local machine - just delete the latest version object: index.html on S3 bucket
In the S3 bucket console aws-first-cloud-journey, in the search box - type index.html
then enter, select Show versions.
permanently delete
in the box -> select Delete objects