r/s3_bucket_lifecycle_configuration: noncurrent_version_transition.newer_noncurrent_versions
reads as zero but cannot be set to zero, causing drift
#23375
Labels
bug
Addresses a defect in current functionality.
documentation
Introduces or discusses updates to documentation.
service/s3
Issues and PRs that pertain to the s3 service.
Community Note
Terraform CLI and Terraform AWS Provider Version
Affected Resource(s)
Terraform Configuration Files
Expected Behavior
terraform apply
a subsequentterraform apply
will show no changes.Actual Behavior
After first apply, output shows
newer_noncurrent_versions = null
.With second apply, Terraform changes
newer_noncurrent_versions
to0
:Side note:, there is also a change reported in
aws_s3_bucket.example
, and if I had a bucket policy, I would see #22314, but I want to limit this issue tonewer_noncurrent_versions
specifically.If I try to work around this by setting
I get the error
If I explicitly set
newer_noncurrent_versions = null
, it still shows up as 0 in the plan and output after the first apply.Note that the
expiration
block works more like expectedUnlike the
noncurrent_version_transition
, theexpiration
block works more like expected. When I setThe output is
the first time and there is no drift. Furthermore, despite what the documentation says, I can write
in the code and it will be accepted and not drift. Also, if I put
null
fordays
andexpired_object_delete_marker
it will behave the same as if I did not include them in the block, which is the expected and desired behavior.Another aside: The documentation says
date
"should be in GMT ISO 8601 Format" but the input does not accept a date likeYYYY-MM-DD
and the error message saysdate
should be in "RFC3339 time format". Please clean up the documentation.Steps to Reproduce
terraform apply -auto-approve
terraform apply
The text was updated successfully, but these errors were encountered: