Versioning in Amazon S3 is a means of keeping multiple variants of an object in the same bucket.You can use the S3 Versioning feature to preserve, retrieve, and restore every version ofevery object stored in your buckets. With versioning you can recover more easily from bothunintended user actions and application failures. After versioning is enabled for a bucket,if Amazon S3 receives multiple write requests for the same object simultaneously, it stores allof those objects.
Versioning-enabled buckets can help you recover objects from accidental deletion oroverwrite. For example, if you delete an object, Amazon S3 inserts a delete marker instead ofremoving the object permanently. The delete marker becomes the current object version. Ifyou overwrite an object, it results in a new object version in the bucket. You can alwaysrestore the previous version. For more information, seeDeleting object versions from aversioning-enabled bucket.
By default, S3 Versioning is disabled on buckets, and you must explicitly enable it. Formore information, seeEnabling versioning on buckets.
The SOAP API does not support S3 Versioning. SOAP support over HTTP is deprecated, but it is still available over HTTPS. New Amazon S3 features are not supported for SOAP.
Normal Amazon S3 rates apply for every version of an object stored and transferred. Each version of an object is the entire object; it is not just a diff from the previous version. Thus, if you have three versions of an object stored, you are charged for three objects.
Buckets can be in one of three states:
Unversioned (the default)
Versioning-enabled
Versioning-suspended
You enable and suspend versioning at the bucket level. After you version-enable abucket, it can never return to an unversioned state. But you cansuspend versioning on that bucket.
The versioning state applies to all (never some) of the objects in that bucket. Whenyou enable versioning in a bucket, all new objects are versioned and given a unique version ID. Objects that already existed in the bucket at the time versioning was enabled will thereafteralways be versioned and given a unique version ID when they are modified by future requests. Note the following:
Objects that are stored in your bucket before you set the versioning statehave a version ID ofnull. When you enable versioning, existingobjects in your bucket do not change. What changes is how Amazon S3 handles theobjects in future requests. For more information, seeWorking with objects in aversioning-enabled bucket.
The bucket owner (or any user with appropriate permissions) can suspendversioning to stop accruing object versions. When you suspend versioning,existing objects in your bucket do not change. What changes is how Amazon S3 handlesobjects in future requests. For more information, seeWorking with objects in a versioning-suspendedbucket.
To customize your data retention approach and control storage costs, use objectversioning with S3 Lifecycle. For more information, seeManaging the lifecycle of objects. Forinformation about creating S3 Lifecycle configurations using the AWS Management Console, AWS CLI, AWS SDKs, orthe REST API, seeSetting an S3 Lifecycle configuration on a bucket.
If you have an object expiration lifecycle configuration in your unversioned bucket andyou want to maintain the same permanent delete behavior when you enable versioning,you must add a noncurrent expiration configuration. The noncurrent expiration lifecycleconfiguration manages the deletes of the noncurrent object versions in the versioning-enabledbucket. (A versioning-enabled bucket maintains one current, and zero or morenoncurrent, object versions.) For more information, seeSetting an S3 Lifecycle configuration on a bucket.
For information about working with S3 Versioning, see the following topics.