terraform-aws-modules / terraform-aws-s3-bucket

Terraform module to create AWS S3 resources 🇺🇦

Home Page:https://registry.terraform.io/modules/terraform-aws-modules/s3-bucket/aws

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ability to keep 'n' noncurrent objects in s3 lifecycle rule.

296951 opened this issue · comments

Is your request related to a new offering from AWS?

Not sure but it is available in the lifecycle rule UI from AWS Console.

Is your request related to a problem? Please describe.

I have a versioned s3 bucket created by terraform. It sets up a lifecycle policy that expires and permanently deletes objects and can result in ALL objects being deleted. I do not want to transition these objects to another storage class but I do want to be able to retain at least 'n' copies on noncurrent objects.

image

Describe the solution you'd like.

I want to setup a lifecycle policy that does the following:

  1. Marks objects as noncurrent after 'n' days'.
  2. Permanently deletes noncurrent objects after 'n' days'.
  3. Keeps 'n' copies of noncurrent objects.

See screenshot of lifecycle rule from AWS Console below:

image

Describe alternatives you've considered.

Create the bucket with terraform and manually configure the below:

image

I hate this idea.

Additional context

Documentation from AWS->Documentation->Amazon Simple Storage Service (S3)->User Guide

image

This issue has been automatically marked as stale because it has been open 30 days
with no activity. Remove stale label or comment or this issue will be closed in 10 days

This issue was automatically closed because of stale in 10 days

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.