S3 Versioning

  • Versioning enables you to keep multiple variants of an object in the same bucket
  • Versioning can help to preserve, retrieve and restore every version of every object
  • If you delete an object, it gets a delete marker and you can restore a previous version
  • If you overwrite an object, it results in a new object version in the bucket and so you can actually restore previous versions prior to the overwrite
  • Objects in buckets can be in three states
    • Unversioned state
    • Versioning-enabled
    • Versioning -suspended

 

Lifecycle Management with versioning

In the previous post, S3 Exam Tips Part 2 we spoke about managing the lifecycle of a bucket and/or its contents using the Lifecycle options.  The post went on to explain how Lifecycle can be configured for those buckets that have not had versioning enabled.  In this post, we will discuss the same options with buckets that have the Versioning option enabled.

  • To enable Versioning on the Bucket, log onto your AWS account and click on your S3 icon in the main dashboard
  • On the left-hand side, you will note all available buckets you currently have.  You can create new buckets from here too.
  • Select the bucket on which you want to enable versioning and on the right-hand side, click Versioning and then click the ‘Enable Versioning‘ buttonenable-versioning-on-bucket
  • Next, you will get a warning screen to tell you that by default all versions will now be stored and that you can use Lifecycle to manage what versions you keep.
  • Next, Click on Lifecycle and then click Add Rulelifecycle-after-enabling-versioning
  • Select the Whole Bucket, for the option Apply the Rule to under the Choose Rule Targetlifecycle-apply-rule-to-whole-bucket
  • Click Configure Rule on the bottom right-hand corner
  • You will be presented with the Configure Rule options which have additional options for how to handle the lifecycle of previous versions.
  • You can set lifecycle rules for both the current versions and previous versions of an object here.action-on-current-and-previous-versions
  • Important Exam Note: Enabling versioning means that if you want to expire a current version of an object, it will not actually delete it.  Instead, if will simply add a delete marker on it but retain the current version as a previous version.  If you need to permanently delete an object, you actually have to expire the current version and then set a Permanent Delete option on under the Action on Previous Versions as shown in the screenshot above
  • Once you have completed the configuration options as shown in the above screenshot, click the ‘Review‘ button
  • Create a Rule Name, check the configuration and then click on the ‘Create and Activate Rule‘ button.  This will then activate your lifecycle rule

 

 Important Exam Tip

  • Once a bucket has been versioned enabled, you cannot disable versioning on the bucket. You can suspend versioning on the bucket, which will stop versioning on future actions performed in the bucket.
  • Version state applies to all objects in a given bucket
  • Objects stored in a bucket before you enabled versioning will have a value of null. Existing objects are not affected when you enable versioning and only future requests to objects are affected by your versioning state
  • Versioning creates additional storage requirements and so you must be aware of this when designing your cloud storage solution.

Multi-Factor Authentication

Additional security can be added to the configuration of a bucket by enabling Multi-Factor Authentication for all Delete requests. This means for versioned-enabled buckets, you will need an additional layer of authentication to enable:

  • Changes to the version state of your bucket
  • Permanent deletes of an object version

 

Additional Exam Tips:

 

180 Practice Exam Questions – Get Prepared for your Exam Day!

Our Exam Simulator with 180 practice exam questions comes with comprehensive explanations that will help you prepare for one of the most sought-after IT Certifications of the year.  Register Today and start preparing for your AWS Certification.