DEV Community

Abhishek Rai
Abhishek Rai

Posted on

Save costs on your versioning-enabled S3 bucket!

Just enable lifecycle policies in your versioning enabled bucket which expires Non Current Versions after 7 days.

Read this document - link

{
  "Rules": [
    {
      "ID": "ExpireNonCurrentVersionsAfter7Days",
      "Status": "Enabled",
      "Filter": {
        "Prefix": ""
      },
      "NoncurrentVersionExpiration": {
        "NoncurrentDays": 7
      }
    }
  ]
}
Enter fullscreen mode Exit fullscreen mode

That's it. Keeping it short. You can add filter conditions in case you want to keep the deletion radius smaller.

Top comments (0)