In Amazon S3, versioning allows you to keep multiple versions of an object within the same bucket. By using S3 versioning you are able to preserve, retrieve and restore all existing versions of the objects stored in the buckets. Once you’ve enabled versioning for a bucket, Amazon S3 will store all versions of an object when it receives multiple write requests for the same object simultaneously.
In this short tutorial we show you how to enable versioning of an s3 bucket.
Enable s3 bucket versioning from s3 console
Sign in to AWS management console and navigate to S3 service section. Note that the bucket owner and all authorized users can enable versioning, hence use an account with adequate credentials.
Go through the Buckets list, or search for the name of the bucket that you want to enable versioning for.
Then go Properties > Bucket Versioning > Edit.
Choose Enable, and then save the changes.
Enable s3 bucket versioning using AWS CLI
If you have AWS CLI configured, enable versioning on an S3 bucket using the following commands:
aws s3api put-bucket-versioning --bucket <bucket-name> --versioning-configuration Status=Enabled
The command doesn’t have any output, but the confirmation can be done from s3 web console under bucket properties section.
The versioning can be turned off by changing the versioning flag to “Suspend” from S3 web console or AWS CLI. For any assistance with AWS tasks and projects, don’t hesitate to contact us.