Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new resource for s3 bucket lifecycle configuration #6188

Closed
cloudyparts opened this issue Oct 17, 2018 · 13 comments · Fixed by #22579
Closed

Add new resource for s3 bucket lifecycle configuration #6188

cloudyparts opened this issue Oct 17, 2018 · 13 comments · Fixed by #22579
Assignees
Labels
new-resource Introduces a new resource. service/s3 Issues and PRs that pertain to the s3 service.
Milestone

Comments

@cloudyparts
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Allow independent systems manage different parts of an s3 bucket configuration.
System A - manages lifecycle of bucket
System B - manages lifecycle of bucket lifecycle configuration
Both systems use terraform modules to isolate change scope.

New or Affected Resource(s)

  • aws_s3_bucket (modifies)
  • aws_s3_bucket_lifecycle_configuration (new)

Potential Terraform Configuration

resource "aws_s3_bucket" "b" {
  bucket = "my-tf-test-bucket"
  acl    = "private"

  tags {
    Name        = "My Bucket"
    Environment = "Dev"
  }
}

resource "aws_s3_bucket_lifecycle_configuration" {
  bucket = "${aws_s3_bucket.b.id}"

  rule  {
    id      = "log"
    enabled = true
    prefix  = "log/"

    tags {
      "rule"      = "log"
      "autoclean" = "true"
    }

    transition {
      days          = 15
      storage_class = "ONEZONE_IA"
    }

    transition {
      days          = 30
      storage_class = "STANDARD_IA"
    }

    transition {
      days          = 60
      storage_class = "GLACIER"
    }

    expiration {
      days = 90
    }
  }

  rule {
    id      = "tmp"
    prefix  = "tmp/"
    enabled = true

    expiration {
      date = "2016-01-12"
    }
  }
}

References

@nywilken nywilken added service/s3 Issues and PRs that pertain to the s3 service. enhancement Requests to existing resources that expand the functionality or scope. labels Feb 1, 2019
@zaphar
Copy link

zaphar commented Apr 23, 2019

Would this make more sense as an addition to the aws_s3_bucket_object resource? That is an already existing location that would make sense to attach lifecycle rules to and is already composable within the existing terraform s3 resources

@zaphar
Copy link

zaphar commented Jan 10, 2020

Has there been any movement on this? The lack of this feature is actually causing me to consider using a different tool for s3 provisioning.

@CYDX-nuna
Copy link

I would like to see this as well. It's making my life very complicated right now.

@realsby
Copy link
Contributor

realsby commented Mar 11, 2020

Yes I need this as well

@adamrothman
Copy link

Another vote for this feature.

@pspot2
Copy link

pspot2 commented Apr 23, 2020

Another vote

@developerinlondon
Copy link

+1

@bflad bflad added this to the v4.0.0 milestone Jul 23, 2020
@bflad bflad added new-resource Introduces a new resource. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Jul 23, 2020
@AchuthSankar
Copy link

+1

@shahnarendra4u
Copy link

+1, this is helpful, if we have a module for S3 and if we need to extend.

As of now as this does not exist, have to use custom resources for same and add lifecycle policy

@pspot2
Copy link

pspot2 commented Mar 24, 2021

@github-actions
Copy link

This functionality has been released in v4.0.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
new-resource Introduces a new resource. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.