Closed cndaan closed 3 months ago
Found the issue and the fix.
The resources.connectivity.tf file has not been update like the resources.virtual_wan.tf file. The "threat_intelligence_allowlist" dynamic block needs to be updated in the resources.connectivity.tf file.
The code now is:
dynamic "threat_intelligence_allowlist" {
for_each = each.value.template.threat_intelligence_allowlist
content {
# Optional attributes
fqdns = lookup(threat_intelligence_allowlist.value, "fqdns", null)
ip_addresses = lookup(threat_intelligence_allowlist.value, "ip_addresses", null)
}
}
This needs to be this: (just like in resources.virtual_wan.tf file)
dynamic "threat_intelligence_allowlist" {
# Ensure that the dynamic block is created only if the allowlist is defined
for_each = length(keys(each.value.template.threat_intelligence_allowlist)) > 0 ? [each.value.template.threat_intelligence_allowlist] : []
content {
# Optional attributes
fqdns = lookup(threat_intelligence_allowlist.value, "fqdns", null)
ip_addresses = lookup(threat_intelligence_allowlist.value, "ip_addresses", null)
}
}
Could someone apply this fix please?
@cndaan Thanks for the investigation here. Would you like to submit a PR for consideration?
@cndaan Thanks for the investigation here. Would you like to submit a PR for consideration?
Yes but I am having issues with creating a Pull Request at the moment. I don't have permission to push to this repository.
Community Note
Versions
terraform: 1.7.3
azure provider: 3.1
module: 5.2.1
Description
Describe the bug
lookup() requires a map as the first argument.
Setting the threat_intelligence_allowlist values results in an error message:
Steps to Reproduce
This is the firewall config I am using: