How to enable versioning in Amazon S3

Introduction

What is Versioning?

Versioning is a means for keeping multiple variants of the same object in the bucket.
Versioning is used to preserve, retrieve, and restore every version of every object stored in an S3 bucket.
Ve…


This content originally appeared on DEV Community and was authored by Amador Criado

Introduction

What is Versioning?

  • Versioning is a means for keeping multiple variants of the same object in the bucket.

  • Versioning is used to preserve, retrieve, and restore every version of every object stored in an S3 bucket.

  • Versioning is done at the S3 Bucket level.

  • Versioning can be enabled from the AWS Console / SDKs / API.

  • Versioning, once enabled, cannot be completely disabled.

  • The alternative to disabling versioning is placing the bucket in a "versioning-suspended" state.

  • 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).

  • 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.

  • 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.

Example Diagram

aws-s3-versioning-diagram.png

Enable Versioning on the S3 bucket

  • Create new Bucket
    aws-s3-versioning-new-bucket.png

  • Enable versioning
    aws-s3-versioning-check-enabled.png

  • To test it, upload new object, we have used the orc avatar for the initial version:

aws-s3-versioning-s3-upload.png

  • Make the bucket public with a Bucket Policy, use the Policy generator and grant public access to getObject in s3:

aws-s3-versioning-policy-gen-click.png

aws-s3-versioning-policygen.png

aws-s3-versioning-policy-json.png

aws-s3-versioning-policy-paste.png

  • Now we upload the same object but with different color balance to differenciate clearly the versions:

aws-s3-versioning-show.png

aws-s3-versioning-select-version.png


This content originally appeared on DEV Community and was authored by Amador Criado


Print Share Comment Cite Upload Translate Updates
APA

Amador Criado | Sciencx (2021-10-08T09:03:28+00:00) How to enable versioning in Amazon S3. Retrieved from https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/

MLA
" » How to enable versioning in Amazon S3." Amador Criado | Sciencx - Friday October 8, 2021, https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/
HARVARD
Amador Criado | Sciencx Friday October 8, 2021 » How to enable versioning in Amazon S3., viewed ,<https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/>
VANCOUVER
Amador Criado | Sciencx - » How to enable versioning in Amazon S3. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/
CHICAGO
" » How to enable versioning in Amazon S3." Amador Criado | Sciencx - Accessed . https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/
IEEE
" » How to enable versioning in Amazon S3." Amador Criado | Sciencx [Online]. Available: https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/. [Accessed: ]
rf:citation
» How to enable versioning in Amazon S3 | Amador Criado | Sciencx | https://www.scien.cx/2021/10/08/how-to-enable-versioning-in-amazon-s3/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.