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

Support S3 lifecycle rules independently from buckets #17432

Closed
wkokolis opened this issue Feb 3, 2021 · 2 comments
Closed

Support S3 lifecycle rules independently from buckets #17432

wkokolis opened this issue Feb 3, 2021 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@wkokolis
Copy link

wkokolis commented Feb 3, 2021

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 other comments that do not add relevant new information or questions, 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

A resource to define S3 bucket lifecycles rules in a stand-alone fashion, much like the security group rule resource. At present, lifecycle rules must be defined in the aws_s3_bucket resource, and because they're nested blocks it's difficult to create a reusable module.

The resource would almost certainly need the ID/ARN of an existing bucket as one of its inputs. This would also likely be incompatible with in-line lifecycle rules.

New or Affected Resource(s)

  • aws_s3_bucket_lifecycle_rule

Potential Terraform Configuration

resource "aws_s3_bucket_lifecycle_rule" "thisrule" {
  bucket_id = aws_s3_bucket.thisbucket.id
  prefix = "somefolder/"
  rule_type = "noncurrent_version_expiration"
  days = 90
}

resource "aws_s3_bucket_lifecycle_rule" "thatrule" {
  bucket_id = aws_s3_bucket.thisbucket.id
  prefix = "somefolder/"
  rule_type = "noncurrent_version_transistion"
  days = 30
  storage_class = "GLACIER"
}

References

None that I could find in a quick search.

@wkokolis wkokolis added the enhancement Requests to existing resources that expand the functionality or scope. label Feb 3, 2021
@ghost ghost added the service/s3 Issues and PRs that pertain to the s3 service. label Feb 3, 2021
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 3, 2021
@ewbankkit
Copy link
Contributor

@ wkokolis Thanks for raising this issue.
It has already been noticed in #6188. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@ewbankkit ewbankkit added new-resource Introduces a new resource. and removed needs-triage Waiting for first response or review from a maintainer. labels Feb 3, 2021
@ghost
Copy link

ghost commented Mar 6, 2021

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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Mar 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. new-resource Introduces a new resource. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

2 participants