Skip to content

Add filter to lifecycle rules in variables.tf for bucket-wide application

Alexandre ETMEZGUINE requested to merge fix/empty-lifecycle-conf-rule-filter into main

When using this module, I had a warning when creating a s3 bucket ressource :

Warning: Invalid Attribute Combination │ │ with module.s3.module.s3_bucket.aws_s3_bucket_lifecycle_configuration.this[0], │ on .terraform/modules/s3.s3_bucket/main.tf line 240, in resource "aws_s3_bucket_lifecycle_configuration" "this": │ 240: resource "aws_s3_bucket_lifecycle_configuration" "this" { │ │ No attribute specified when one (and only one) of │ [rule[0].filter[0].prefix.<.object_size_greater_than,rule[0].filter[0].prefix.<.object_size_less_than,rule[0].filter[0].prefix.<.and,rule[0].filter[0].prefix.<.tag] │ is required │ │ This will be an error in a future version of the provider

The issue comes from the fact that the safrangrp module calls the official terraform s3 module and the rules sent to the official module miss one attribute.

I had a filter prefix empty attribute to reproduce the previous behaviour and test it by redeploying an object that use the module. In the runner logs, I don't see the warning anymore.

Merge request reports