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]: aws_s3_bucket_lifecycle_configuration using recommended empty filter issues warning #41710

Open
Pesticles opened this issue Mar 6, 2025 · 7 comments
Labels
bug Addresses a defect in current functionality. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@Pesticles
Copy link

Terraform Core Version

1.10.5

AWS Provider Version

5.90.0

Affected Resource(s)

aws_s3_bucket_lifecycle_configuration

Expected Behavior

When using the aws_s3_bucket_lifecycle_configuration resource the documentation recommends using an empty filter block for rules which apply to the entire bucket.

Actual Behavior

The planner issues a warning

Relevant Error/Panic Output Snippet

│ No attribute specified when one (and only one) of [rule[0].prefix.<.filter] is required
│ 
│ This will be an error in a future version of the provider

Terraform Configuration Files

resource "aws_s3_bucket_lifecycle_configuration" "lifecycle_sensitive_access_log" {
bucket = aws_s3_bucket.collector_bucket_sensitive_access_log.id

rule {
id = "Delete"
status = "Enabled"
filter {}
expiration {
days = 366
}
}
}

Steps to Reproduce

Create a lifecycle configuration with a rule using an empty filter block

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

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

github-actions bot commented Mar 6, 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 6, 2025
@Tenzer
Copy link
Contributor

Tenzer commented Mar 7, 2025

I'm seeing the same with version 5.90.0 of the provider. I'm guessing it's caused by the change in #40796.

@JamesWhyley
Copy link

We've run into this issue today. For what it's worth we were bumping from 5.89.0 which didn't exhibit this behaviour so it does look like it may be down to the change @Tenzer mentioned.

@ewbankkit ewbankkit added regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. and removed needs-triage Waiting for first response or review from a maintainer. labels Mar 7, 2025
@github-actions github-actions bot added the prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. label Mar 7, 2025
@BroMattMiller
Copy link

Using provider 5.90.0 I also get a similar warning when completely omitting the "filter" option:

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

My understanding from the docs is that omitting both filter and prefix from the rule is the recommended way to create a rule that applies to all objects in the bucket. I take the docs to say that specifying an empty filter applies the rule to objects with an empty string as a prefix (whatever that means), but that omitting the filter applies the rule to all objects.

@grimm26
Copy link
Contributor

grimm26 commented Mar 7, 2025

@grimm26
Copy link
Contributor

grimm26 commented Mar 7, 2025

Using provider 5.90.0 I also get a similar warning when completely omitting the "filter" option:

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

My understanding from the docs is that omitting both filter and prefix from the rule is the recommended way to create a rule that applies to all objects in the bucket. I take the docs to say that specifying an empty filter applies the rule to objects with an empty string as a prefix (whatever that means), but that omitting the filter applies the rule to all objects.

quite frustrating since I was finally able to refactor my s3 module to not create a filter { prefix = "" } rule.

@Drewster727
Copy link

Guess I'm staying on 5.89.0 until this gets addressed :)

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. prioritized Part of the maintainer teams immediate focus. To be addressed within the current quarter. regression Pertains to a degraded workflow resulting from an upstream patch or internal enhancement. service/s3 Issues and PRs that pertain to the s3 service.
Projects
None yet
Development

No branches or pull requests

7 participants