You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.
│ Error: Unknown variable
│
│ on main.tf line 22, in resource "azurerm_eventhub_namespace""namespace":
│ 21: for_each = var.ip_rules
│
│ There is no variable named "var".
Expected Behaviour
for_each should have iterated through the set
I have tried differend
Actual Behaviour
Returns the error " There is no variable named "var"."
Steps to Reproduce
Terraform init
Tearraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered:
@haffimt Thanks for opening this issue to us, to be honest, I'm quite surprise to confirm that I can actually reproduce this issue on my side, fascinating.
After playing around with the nested block for a while I just realized that this issue must be caused by the resource schema:
SchemaConfigModeAttr implies these "blocks" are actually treated as attributes, that's why you cannot use classic dynamic with var or local key words in your for_each here. I've tried the following config and it worked:
I believe there must be a sound justification to mark them SchemaConfigModeAttr here, so I don't think it's possible to change the schema, but we can solve your issue by treating this "block" as an attribute with object type.
Is there an existing issue for this?
Community Note
Terraform Version
1.9.8
AzureRM Provider Version
4.9.0
Affected Resource(s)/Data Source(s)
azurerm_eventhub_namespace
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
for_each should have iterated through the set
I have tried differend
Actual Behaviour
Returns the error " There is no variable named "var"."
Steps to Reproduce
Terraform init
Tearraform apply
Important Factoids
No response
References
No response
The text was updated successfully, but these errors were encountered: