-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Send empty list when using condition (load_balancer_backend_address_pools_ids) #1318
Comments
Hello @JamesDLD, Sorry to hear this has been a problem for you. I don't think the provider should be silently ignoring empty strings to send an empty array, if anything it should be validating that all ID's passed in are valid and as such I will shortly open a PR to enforce this. My reasoning is if someone is doing some interpolation and accidentally ends up with I think this is better solved in the terraform config and I believe this could be done by adding a load_balancer_backend_address_pools_ids = "${compact(split(" ", "${lookup(var.Linux_Vms[count.index], "Id_Lb")}" == "777" ? "" : "${element(var.lb_backend_ids,lookup(var.Linux_Vms[count.index], "Id_Lb"))}" ))}" Could you please give this a try and let me know if it solves the issue for you? Thanks! |
Thank you @katbyte !! The workaround “compact” with “bracelet” did the job like a charm. load_balancer_backend_address_pools_ids = ["${compact(split(" ", "${lookup(var.Linux_Vms[count.index], "Id_Lb")}" == "777" ? "" : "${element(var.lb_backend_ids,lookup(var.Linux_Vms[count.index], "Id_Lb"))}" ))}"] |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
Community Note
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
Panic Output
Expected Behavior
Send the following when the condition is set to 777 ==>
Actual Behavior
It currently sends an empty string when the condition is set to 777 ==>
Steps to Reproduce
terraform apply
Important Factoids
The condition is working fine when the parameter is a string, in the upper tf I had an example for the parameter network_security_group_id
References
The text was updated successfully, but these errors were encountered: