Skip to main content
Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console. Open IP Lab Portal

Overview

Lab Details

  1. This lab walks you through the steps on how to enables versioning on an AWS S3 Bucket. Versioning allows you to keep multiple versions of an object in one bucket.
  2. Duration: 30 minutes
  3. AWS Region: US East (N. Virginia) us-east-1

Introduction

What is Versioning?

  1. Versioning is a means for keeping multiple variants of the same object in the bucket.
  2. Versioning is used to preserve, retrieve, and restore every version of every object stored in an S3 bucket.
  3. Versioning is done at the S3 Bucket level.
  4. Versioning can be enabled from the AWS Console / SDKs / API.
  5. Versioning, once enabled, cannot be completely disabled.
  6. The alternative to disabling versioning is placing the bucket in a “versioning-suspended” state.
  7. A drawback of having multiple versions of an object is you are billed multiple times (since the objects are getting stored in S3 each time).
  8. In order to avoid having multiple versions of the same object, S3 has a feature called Lifecycle  Management. This allows us to decide on what to do when multiple versions of an object are piling up.
  9. One advantage of versioning is, we can provide permissions on versioned objects i.e., we can define which version of an object is public and which one is private.

Architecture Diagram

Task Details

  1. Sign in to AWS Management Console.
  2. Create an S3 bucket.
  3. Enable versioning on the S3 bucket.
  4. Upload an object and make the bucket public.
  5. Upload different versions of the file.
  6. Test the versioning of the object.

Launching Lab Environment

  1. To launch the lab environment, Click on the Start Lab button.
  2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
  3. Once the Lab is started, you will be provided with IAM user name, Password, Access Key, and Secret Access Key.
Note : You can only start one lab at any given time

Files you need

Download these before you start — the lab cannot be completed without them.

Lab guide

Lab Steps

Task 1: Sign in to AWS Management Console

  1. Click on the Open Console button, and you will get redirected to AWS Console in a new browser tab.
  2. On the AWS sign-in page,
  • Leave the Account ID as default. Never edit/remove the 12 digit Account ID present in the AWS Console. otherwise, you cannot proceed with the lab.
  • Now copy your User Name and Password in the Lab Console to the IAM Username and Password in AWS Console and click on the Sign in button.
  1. Once Signed In to the AWS Management Console, Make the default AWS Region as US East (N. Virginia) us-east-1.

Task 2: Create an S3 Bucket

In this task , we are going to create an S3 bucket with the required configurations like name, access and region.
  1. Navigate to the Services menu at the top and click on S3 in the Storage section.
  2. On the S3 dashboard, click on Create bucket button and fill in the bucket details.
  3. Select Region as N.Verginia to create an S3 bucket.
  • Bucket type Select : General purpose
  • Bucket name**:** Enter whizlabs-<RANDOM_NUMBER>
  • Note: S3 bucket names are globally unique, choose an available name.
  • Object ownership: Select ACLs disabled (recommended) option
  • Uncheck the option**, Block all public access,** and check the acknowledge option.
  • Leave other settings as default.
  • Click on Create bucket button.
  1. Your S3 Bucket is now created.

Task 3: Enable Versioning on the S3 bucket

  1. Click on your bucket name whizlabs2346.
  2. Click on Properties tab.
  1. Under Bucket Versioning, click on Edit button.
  2. Bucket Versioning : Select Enable radio button.
  1. Now Click on the Save changes button.
  2. Now Bucket versioning is enabled.

Task 4: Upload an object and make the bucket public

  1. Click on the Objects tab.
  2. In the Overview, you can see the following message:
    • This bucket is empty. Upload new objects to get started.
  1. Upload sample.txt file present in zip file download the zip file from our Download Me link.
  2. To upload a file to our S3 bucket,
    • Click on the Upload button.
    • Click on the Add files button.
    • Browse for the file you want to upload.
    • Click on the Upload button.
    • You can watch the progress of the upload from within the transfer panel at the bottom of the screen. If it’s a small file, you might not see the transfer. Once your file has been uploaded, it will be displayed in the bucket.
  1. Now click on the Close button on the top right corner of the screen.
  2. To copy the ARN of your S3 bucket, click on Properties tab and copy the ARN.
  3. Make the bucket public with a Bucket Policy:
    • Click the Permissions tab to configure your bucket:
    • Scroll down to Bucket policy , click on Edit button on the Right side.
    • The policy editor will open.
  • In the policy below, update your bucket ARN in the Resource key-value and copy the policy code.
  • Paste the bucket policy into the Bucket policy editor.
  • Click on Save Changes button
  1. Now again open the Objects tab, select the object name and click on Copy URL.
  1. Open a new tab, paste the URL and you will get the below output.

Task 5: Upload different versions of the file

  1. Now open the sample.txt file in your local text editor and update the file content as “This is version 2”.
  2. Click on the Upload button.
  3. Click on the Add files button.
  4. Browse for the file you want to upload.
  5. Click on the Upload button.
  6. Now click on the Close button on the top right corner of the screen.
  7. Once the file has been uploaded successfully, copy the URL and paste it into your browser.
  8. You should see the latest version of the file you uploaded.
  1. Similarly, again edit the sample.txt and update the content as “This is version 3”.
  2. Then upload the file into the bucket and check the output in the browser.

Task 6: Test the Versioning of the object

  1. Open your S3 bucket, click on Show versions. You will get the list of versions available for your sample.txt.
  1. Now delete the first object and try to see the output in the browser.
  1. You will get the output as “This is version 2”.
  2. Hence, when you delete the object from the bucket, the bucket pointer points to the previously available version.
Do you know?
Enabling versioning can impact storage costs since each version of an object consumes storage space. You are billed for the storage of all versions, including the current version and any previous versions. However, S3 provides options for lifecycle policies, which can automatically transition or expire older versions to help manage storage costs effectively.
  1. Once the lab steps are completed, please click on the Validation button on the left side panel.
  2. This will validate the resources in the AWS account and shows you whether you have completed this lab successfully or not.

Completion and Conclusion

  1. You have successfully created an S3 Bucket.
  2. You have successfully enabled Object Versioning on the Bucket.
  3. You have successfully uploaded a test file into the Bucket and tested its versioning.
  4. You have successfully validated the lab.

End Lab

  1. Sign out from the AWS Management Console.
  2. Click on End Lab button from IP Lab Portal Labs console and wait till the process gets completed

What gets checked

When you press Check my work, the platform verifies each of these:
  • Create an AWS S3 Bucket with Policy — Check whether S3 bucket is created and bucket policy added or not
  • Enable S3 Bucket Versioning — Check whether S3 Bucket versioning in Enabled or not.
  • Invoke S3 Object URL — Check whether an S3 Object URL is accessible from the internet or not.