Hi there, I’m trying to write a module that accepts an object as a variable, however when I try to reference that variable in a dynamic block, terraform validate says that “var” isn’t defined…
resource "azurerm_frontdoor_firewall_policy" "fd_waf_policy" {
name = var.name
resource_group_name = var.resource_group_name
location = var.location
dynamic "custom_rule" {
for_each = var.policy
content {
...
}
}
}
The error is this:
│ Error: Unknown variable
│
│ on modules\fd-waf\main.tf line 11, in resource “azurerm_frontdoor_firewall_policy” “fd_waf_policy”:
│ 11: for_each = var.policy
│
│ There is no variable named “var”.
I’m using TF 1.2.1 on Windows