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 causes drift when nothing has actually changed #41460

Closed
johannes-gehrs opened this issue Feb 19, 2025 · 4 comments
Labels
bug Addresses a defect in current functionality. service/s3 Issues and PRs that pertain to the s3 service.

Comments

@johannes-gehrs
Copy link

johannes-gehrs commented Feb 19, 2025

Terraform Core Version

1.10.5

AWS Provider Version

5.86.0 and higher

Affected Resource(s)

aws_s3_bucket_lifecycle_configuration

Expected Behavior

No drift if neither resources nor templates have changed

Actual Behavior

We see drift such as this

!     rule {
          id     = "abc"
          # (1 unchanged attribute hidden)

-         filter {
          }

-         noncurrent_version_transition {
-             noncurrent_days = 0 -> null
-             storage_class   = "INTELLIGENT_TIERING" -> null
          }
+         noncurrent_version_transition {
+             newer_noncurrent_versions = (known after apply)
+             noncurrent_days           = 0
+             storage_class             = "INTELLIGENT_TIERING"
          }
      }

The empty filter element appears to be removed. newer_noncurrent_versions is set to an unknown value.

We also see drift that looks like this

!     transition_default_minimum_object_size = "varies_by_storage_class" -> "all_storage_classes_128K"

And finally and most worrisome, it looks like Terraform wants to apply a material change to a filter element in some cases

!         filter {
+             object_size_greater_than = (known after apply)
+             object_size_less_than    = (known after apply)
              # (1 unchanged attribute hidden)
          }

Is this expected?

It appears to be caused by the changes/rewrite introduced in #41159
It does not occur in version 5.85.0

Relevant Error/Panic Output Snippet

Terraform Configuration Files

Not sure what the expectation is, here. You'll need both full configuration and state files to replicate this, and I cannot give you this.

Steps to Reproduce

Perform a plan

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

No

@johannes-gehrs johannes-gehrs added the bug Addresses a defect in current functionality. label Feb 19, 2025
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

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.

@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Feb 19, 2025
@justinretzolk
Copy link
Member

Hey @johannes-gehrs 👋 Thank you for taking the time to raise this! This looks like it's related to some changes that were necessary with the aws_s3_bucket_lifecycle_configuration resource in version 5.86.0 that appear to be affecting you in a couple of ways.

For the reason behind these changes and some information around the transition_default_minimum_object_size bit of your issue, see #41126. In making the necessary changes to cope with the information in that issue, some configurations experienced unexpected drift similar to what you're reporting. There was quite a bit of discussion around that in a similar issue recently (#41268), where I wrote up a fairly lengthy comment detailing some of the behavior changes.

Can you review that and verify that by updating the configuration accordingly, you're able to get around this?

@justinretzolk justinretzolk added waiting-response Maintainers are waiting on response from community or contributor. service/s3 Issues and PRs that pertain to the s3 service. labels Feb 19, 2025
@johannes-gehrs
Copy link
Author

Thank you, I will close this in favor of the existing isue.

Copy link

Warning

This issue has been closed, meaning that any additional comments are hard for our team to see. 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.

@github-actions github-actions bot removed waiting-response Maintainers are waiting on response from community or contributor. needs-triage Waiting for first response or review from a maintainer. labels Feb 20, 2025
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