Open In App

Amazon S3 Versioning Using CLI

Amazon Simple Storage Service (S3) is a highly scalable, durable, and secure object storage service provided by AWS. The S3 offers versioning ability which would let you keep several versions of an object in the same bucket. In other words, it means that when you add an object with the similar key (name) into a versioned bucket, S3 keeps all versions of the object thus making possible for users to get back previous versions as and when required. This article will go into great detail about AWS S3 versioning including terminologies involved, how it is implemented and some common use cases as well.

Understanding Of Primary Terminologies

Amazon S3 Versioning: A Step-By-Step Guide

Step 1: Access the AWS Management Console



Step 2: Navigate To Amazon S3



Step 3: Enabling Versioning

Step 4: Uploading Objects

Step 5: Listing Object Versions

Step 6: Deleting Object Versions

Step 7: Restoring Previous Versions

Amazon S3 Versioning Using AWS CLI: A Step-By-Step Guide

Follow the AWS CLI installation instructions available at Install the latest version of the AWS CLI.

Step 1 : Configure the AWS CLI

Use “aws configure” to set up your AWS CLI with your AWS access key ID, secret access key, default region, and output format. you can find access key ID and secret access key in IAM Security Credentials.

Step 2: Create S3 Bucket

Step 3 : Enabling Versioning

Step 4: Uploading Objects

Step 5: Listing Object Versions

Step 6 : Deleting Object Versions

Step 7: Restoring Previous Versions

Amazon S3 Versioning – FAQ’s

Can I Disable Versioning Once It’s Enabled?

Yes, you can disable versioning on an S3 bucket, which will remove all existing versions of objects.

How Can I Restore A Deleted Object From A Versioned Bucket?

You can restore a deleted object by deleting the delete marker for that object.

Is There A Limit To The Number Of Versions I Can Store?

No, there is no limit to the number of versions you can store in a versioned bucket.

How Does Versioning Affect Storage Costs?

Versioning may increase storage costs since each version of an object is stored separately.

Can I use lifecycle policies with versioned objects?

Yes, you can use lifecycle policies to manage versions of objects in a versioned bucket.


Article Tags :