Paillou
Paillou

Reputation: 839

Deactivate versioning on s3 buckets

I activated versioning on my bucket. I used :

aws s3api put-bucket-versioning --bucket my_bucket --versioning-configuration Status=Enabled --endpoint-url https://XXXXXXXXX

Now, I would like to deactivate that versioning on that bucket. So, I have 2 questions :

or do I need to edit the ./lifecycle.json file at the "Status" line ?

{
    "Rules": [
        {
            "ID": "Delete old versions after 90 days",
            "Status": "Enabled",   -> Suspended 
            "Prefix": "",
            "NoncurrentVersionExpiration": {
                "NoncurrentDays": 90
              }
        }
    ]
}

Probably, both solution work?

Bests

Upvotes: 4

Views: 11422

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 270224

Versioning cannot be turned off, it can only be Suspended.

So, yes, you would use Status=Suspended to deactivate the Versioning process.

The Lifecycle operation is independent of the bucket's Versioning status. Your lifecycle policy is configured to delete previous versions after 90 days. Leave it with its current configuration and it will continue to expire old versions for the next 90 days. After that, it won't do anything since there are no new versions of objects to expire, so you could then delete the Lifecycle rule. (So, don't change anything for now.)

If you wish to immediately delete all non-current versions of objects, you could modify the Lifecycle rule and set NoncurrentDays to 1, to make the versions expire (delete) quicker. (I'm not sure if it will work with zero.)

Upvotes: 9

Related Questions