Loading...
Loading...
### Terraform Version ```shell Terraform v1.12.1 on windows_amd64 + provider registry.terraform.io/hashicorp/azurerm v4.31.0 ``` ### Terraform Configuration Files First block: module file ```terraform resource "azurerm_eventhub_namespace" "main" { name = "test-eh" location = "eastus2" resource_group_name = "test-rg" sku = "Basic" network_rulesets { default_action = "Allow" dynamic "ip_rule" { for_each = var.namespace_ip_rule content { ip_mask = ip_rule.value } } dynamic "virtual_network_rule" { for_each = var.namespace_virtual_network_rule content { subnet_id = virtual_network_rule.value } } } } variable "namespace_virtual_network_rule" { description = "Map of virtual network rules for the Event Hub Namespace" type = list(string) } variable "namespace_ip_rule" { description = "List of IP rules for the Event Hub Namespace" type = list(string) } ``` Second Block: main file ```terraform module "test" { source = "./module/eventhub" namespace_virtual_network_rule = [""] namespace_ip_rule = ["127.0.0.1"] } ``` ### Debug Output https://gist.github.com/peruzzof/4e388fbd7e8642481e44bea70fdeec23 ### Expected Behavior It should confirm that the file is valid ### Actual Behavior ➜ terraform validate ╷ │ Error: Unknown variable │ │ on module\eventhub\main.tf line 12, in resource "azurerm_eventhub_namespace" "main": │ 12: for_each = var.namespace_ip_rule │ │ There is no variable named "var". ╵ ╷ │ Error: Unknown variable │ │ on module\eventhub\main.tf line 19, in resource "azurerm_eventhub_namespace" "main": │ 19: for_each = var.namespace_virtual_network_rule │ │ There is no variable named "var". ### Steps to Reproduce 1. `terraform init` 2. `terraform validate` ### Additional Context _No response_ ### References _No response_ ### Generative AI / LLM assisted development? _No response_
Click on a version to see all relevant bugs
Terraform Integration
Learn more about where this data comes from
Bug Scrub Advisor
Streamline upgrades with automated vendor bug scrubs
BugZero Enterprise
Wish you caught this bug sooner? Get proactive today.