feat: Add validation for lifecycle_rule along with terraform tests #303
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.
Description
I have added a simple validation for lifecycle_rule that ensures correct configuration is passed to the module.
Motivation and Context
In my company, we experienced that passing an incorrect map doesn't break the plan & apply pipelines but it also doesn't actually apply the required change. The main reason for this change is also that the configuration in this module is slightly different than what is explained on aws_s3_bucket_lifecycle_configuration which users usually confuse with.
Breaking Changes
It is backwards compatible according to the tests I performed.
How Has This Been Tested?
examples/*to demonstrate and validate my change(s)There already are examples.
examples/*projectsI have also tested using terraform tests and a private project
pre-commit run -aon my pull request