When trying to map an existing Elastic IP to a new vmseries ENI (specifying the eip_allocation_id variable), TF plan is failing because the "try(v.eip_allocation_id, false)" (line 54) does return a string (allocation id value) instead of a boolean. Then the if clause crashes with "The 'if' clause value is invalid: a bool is required." message.
Module Version
v1.0.1
Terraform version
v1.3.6
Expected behavior
Setting eip_allocation_id variable should work as expected
Current behavior
TF plan fails when eip_allocation_value is set to a correct value.
Anything else to add?
Something like that should fix the issue:
for_each = { for k, v in var.interfaces : k => v if (try(v.eip_allocation_id, false) != false)}
Describe the bug
When trying to map an existing Elastic IP to a new vmseries ENI (specifying the eip_allocation_id variable), TF plan is failing because the "try(v.eip_allocation_id, false)" (line 54) does return a string (allocation id value) instead of a boolean. Then the if clause crashes with "The 'if' clause value is invalid: a bool is required." message.
Module Version
v1.0.1
Terraform version
v1.3.6
Expected behavior
Setting eip_allocation_id variable should work as expected
Current behavior
TF plan fails when eip_allocation_value is set to a correct value.
Anything else to add?
Something like that should fix the issue: for_each = { for k, v in var.interfaces : k => v if (try(v.eip_allocation_id, false) != false)}