-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when using lifecycle rule with null values #308
Comments
This issue has been automatically marked as stale because it has been open 30 days |
Remove stale label |
This issue has been automatically marked as stale because it has been open 30 days |
Hi @antonbabenko any thoughts on this? |
@GusAntoniassi This looks pretty good. I currently don't have time to run the examples and verify a few cases. Hopefully, I will be able to do it in the near future. |
Description
When trying to use a lifecycle rule while passing null values for
transition
,noncurrent_version_transition
andfilter
inputs, Terraform throws a "null value has no attributes" error. I believe this is due to how thefor_each
blocks are implemented:Since there is no
compact
, theflatten
call will return[null]
which is a valid list with one value.In my case the
null
values are coming from a variable withoptional
fields, so it would be best if the module could handle null values correctly.Versions
Module version [Required]: 4.5.0
Terraform version: 1.7.5
Reproduction Code [Required]
Steps to reproduce the behavior:
terraform plan
Expected behavior
The plan to create a bucket with an empty lifecycle rule.
Actual behavior
Error:
The text was updated successfully, but these errors were encountered: