Cost Consideration: Each version of an object is stored as a complete copy, not just differences. If you have 3 versions of a file, you pay for 3 complete files. AWS charges normal S3 rates for every version stored and transferred. Consider using lifecycle policies to manage old versions.
Versioning in Amazon S3 is a feature that allows you to keep multiple variants of an object in the same bucket. With versioning enabled, you can preserve, retrieve, and restore every version of every object stored in your bucket, providing an additional layer of data protection against accidental deletion or modification.
When versioning is enabled on a bucket:
S3 buckets can be in one of three versioning states:

In the S3 bucket interface, select your bucket name.
Select Properties, then under the Bucket Versioning section, select Edit.

In the Bucket Versioning section, select Enable and Save changes.

Open the folder containing the files downloaded from step 2.2.
Select the index.html file, right-click, and select Open with > Notepad (or Edit in Notepad).

Change the content AWS First Cloud AI Journey to HỌC CLOUD AI VUI BIẾT BAO <3 inside the body tag.
Save the changes using the key combination Ctrl + S.
Before editing:

After editing:

Access the S3 bucket interface AWS First Cloud AI Journey, select Upload.
Drag and drop the edited index.html file into the bucket.

Complete the upload process, then select Close.

Search for index.html, then toggle Show versions to see the versions of the file.

You will see two versions of the index.html file with different modification times.

Access 7.3 Check Amazon CloudFront and view the Distribution domain name.

See whether the Default root object changes after uploading the new version of index.html or not.
Access Amazon CloudFront at https://console.aws.amazon.com/cloudfront/home, select the current Distribution ID.

Select Behaviors, then select Edit.

Under Cache key and origin requests, in the Cache policy section, select CachingDisabled. Then select Save changes.

Wait until the status changes from Deploying to the last modified time.


Copy the Domain name into the browser to see the changes.

To quickly restore the old content, delete the latest version of the index.html object in the S3 bucket.

Select the object to delete and click Delete.

Check and confirm the deletion by entering permanently delete and selecting Delete objects.

Refresh the browser running the CloudFront Domain name to see the old content restored.
