Ressource aws_s3_bucket_lifecycle_configuration
> object_size_greater_than
doesn’t work when used at Filter level
#23575
Labels
bug
Addresses a defect in current functionality.
service/s3
Issues and PRs that pertain to the s3 service.
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform 0.14 but reproduced with 0.15 and 1.0
AWS provider 4.4.0 and 4.3.0
Affected Resource(s)
Terraform Configuration Files
This code doesn’t update the real infrastructure, it keeps planning the same change over and over
Debug Output
The output produced
The output stay the same when applying multiple times (as it doesn’t change the real infrastructure)
Panic Output
If I manually modify the corresponding field in the AWS console (I put 2MB of object size minimal), I got the following panic when terraform is planning the changes :
Error: error setting rule: rule.0.filter.0.object_size_greater_than: '' expected type 'string', got unconvertible type 'int', value: '2097152'
Quick fix
It’s possible to avoid this using the
and
clause :It produced a working output (we can observe that the int type is here, instead of string in the faulty case)
And the real infrastructure is changed 🎉
References
I guess this code seems incriminated :
terraform-provider-aws/internal/service/s3/bucket_lifecycle_configuration.go
Line 95 in 1d268ac
The text was updated successfully, but these errors were encountered: