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

[Bug]: S3 Lifecycle rule with no filter gives a warning #41725

Closed
BroMattMiller opened this issue Mar 7, 2025 · 3 comments
Closed

[Bug]: S3 Lifecycle rule with no filter gives a warning #41725

BroMattMiller opened this issue Mar 7, 2025 · 3 comments
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@BroMattMiller
Copy link

BroMattMiller commented Mar 7, 2025

Terraform Core Version

1.11.1

AWS Provider Version

5.90.0

Affected Resource(s)

aws_s3_bucket_lifecycle_configuration

Expected Behavior

If I understand the provider docs correctly, it's recommend to omit both filter and prefix options from a rule that should apply to all objects in the bucket. If I do this I get such a rule in AWS, but "terraform apply" gives an "Invalid Attribute Combination" warning. No warning should be issued in this case.

Actual Behavior

The warning includes:

No attribute specified when one (and only one) of [rule[0].prefix.<.filter] is required

Relevant Error/Panic Output Snippet

Terraform Configuration Files

resource "aws_s3_bucket_lifecycle_configuration" "main" {
  for_each = toset(local.data_bucket_types)

  bucket = aws_s3_bucket.main[each.key].id

  rule {
    id     = aws_s3_bucket.main[each.key].id
    status = "Enabled"

    expiration {
      expired_object_delete_marker = true
    }

    noncurrent_version_expiration {
      noncurrent_days           = 90
      newer_noncurrent_versions = 2
    }

    abort_incomplete_multipart_upload {
      days_after_initiation = 10
    }
  }
}

Steps to Reproduce

Create a lifecycle configuration with no filter and no prefix

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@BroMattMiller BroMattMiller added the bug Addresses a defect in current functionality. label Mar 7, 2025
Copy link

github-actions bot commented Mar 7, 2025

Community Guidelines

This comment is added to every new Issue to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀

Voting for Prioritization

  • Please vote on this Issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize it.
  • Please see our prioritization guide for additional information on how the maintainers handle prioritization.
  • Please do not leave +1 or other comments that do not add relevant new information or questions; they generate extra noise for others following the Issue and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.
  • For new resources and data sources, use skaff to generate scaffolding with comments detailing common expectations.

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/s3 Issues and PRs that pertain to the s3 service. labels Mar 7, 2025
@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Mar 7, 2025
@ewbankkit
Copy link
Contributor

@BroMattMiller Thanks for raising this issue.
It has already been noticed in #41710. 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.

Copy link

github-actions bot commented Mar 7, 2025

Warning

This Issue has been closed, meaning that any additional comments are much easier for the maintainers to miss. Please assume that the maintainers will not see them.

Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

2 participants