r/aws_s3_bucket_lifecycle_configuration: preserve transition_default_minimum_object_size when backend omits it - #49902
Open
kayrus wants to merge 1 commit into
Conversation
Contributor
Community GuidelinesThis comment is added to every new Pull Request 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
Pull Request Authors
|
…minimum_object_size when backend omits it S3-compatible backends (e.g. Ceph RADOS Gateway) omit the x-amz-transition-default-minimum-object-size field on GET. Preserve the planned/prior value when the flattened value is empty, and tolerate an empty observed value in lifecycleConfigEqual so stabilization can converge.
kayrus
force-pushed
the
b-s3-lifecycle-transition-min-size-empty
branch
from
September 9, 2026 10:06
2380ad8 to
9464d5c
Compare
Author
|
@gdavison @jar-b @ewbankkit @YakDriver could you please review this PR? |
Member
Author
|
@justinretzolk Thanks for your attention. The #48457 still doesn't work with the Ceph S3 backend. The the #49547 looks similar to my PR. Would be nice if you pick up one PR and review/merge it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
No. This change does not alter any access controls, encryption, or logging behavior.
Description
aws_s3_bucket_lifecycle_configurationnever stabilized on S3-compatiblebackends (e.g. Ceph RADOS Gateway), timing out during create/update.
The resource waits for the applied configuration to be readable back before
returning. That comparison includes
transition_default_minimum_object_size,which the provider defaults to
128kfor general purpose buckets. AWS S3always returns the corresponding
x-amz-transition-default-minimum-object-sizefield on
GetBucketLifecycleConfiguration, but the field is optional andS3-compatible backends omit it. The observed value therefore came back empty
and never matched the requested
128k, so the stabilization wait(
waitLifecycleConfigEquals) could never reach its target and timed out.The empty value flattened into state also produced "inconsistent result after
apply" errors and perpetual diffs.
This change:
lifecycleConfigEqual, so thestabilization wait converges when the backend omits the field. The check is
asymmetric by design — an empty observed value matches any requested value,
but a non-empty observed value must still match exactly.
transition_default_minimum_object_sizewhen the flattened value is empty,avoiding the inconsistent-result error and perpetual diff.
On real AWS S3 both behaviors are strict no-ops, because AWS always populates
the field: the observed value is never empty, so the equality guard reduces to
the original comparison and the value is never preserved from an empty result.
Note: the ~3 minute timeout reported in the issue is the create/update
stabilization timeout. With this fix the configuration converges as soon as the
backend reports matching rules, so the operation completes within the default
window rather than timing out.
Relations
Closes #25939
References
GetBucketLifecycleConfigurationx-amz-transition-default-minimum-object-sizeis an optional response field: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.htmlOutput from Acceptance Testing
Unit coverage for the equality guard, which encodes the asymmetric
empty-tolerance behavior: