Skip to content
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

Bug report - azurerm_eventhub_namespaces network_rulesets and ip_rule do not work #1881

Closed
1 task done
arne21a opened this issue Dec 1, 2023 · 0 comments · Fixed by #1882
Closed
1 task done

Bug report - azurerm_eventhub_namespaces network_rulesets and ip_rule do not work #1881

arne21a opened this issue Dec 1, 2023 · 0 comments · Fixed by #1882
Assignees
Labels
bug Something isn't working eventhub
Milestone

Comments

@arne21a
Copy link
Contributor

arne21a commented Dec 1, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • 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 "+1" or "me too" comments, 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

Version of the module you are using

5.7.5

Rover Version

aztfmod/rover:1.4.6-2305.1807

Terraform Version

v1.4.6 on linux_arm64

AzureRM Provider Version

3.75.0

Affected Resource(s)/Data Source(s)

azurerm_eventhub_namespace

Terraform Configuration Files

event_hub_namespaces = {
  eventhub_namespace = {
    name = "ns-management"
    resource_group_key = "rg1"
    sku                      = "Standard"
    capacity                 = 2
    maximum_throughput_units = 10
    auto_inflate_enabled     = true
    network_rulesets = {
      ruleset_1 = {
        default_action = "Deny"
        trusted_service_access_enabled = true
        virtual_network_rule = {
          subnet_1 = {
            subnet_id = "subnet_id"
            ignore_missing_virtual_network_service_endpoint = false
          }
          subnet_2 = {
            # Fixme: implement lookup
            subnet_id = "subnet_id"
            ignore_missing_virtual_network_service_endpoint = false
          }
        }
      }
    }
  }
}

Expected Behaviour

virtual_network_rule are getting created

Actual Behaviour

The nested dynamic block is virtual_network_rule is referencing var.settings.network instead of the iterated value network_rulesets.value.virtual_network_rule. Therefore the nested block always evaluates to {}

  dynamic "network_rulesets" {
    for_each = try(var.settings.network_rulesets, {})
    content {
      default_action                 = network_rulesets.value.default_action #Possible values are Allow and Deny. Defaults to Deny.
      trusted_service_access_enabled = try(network_rulesets.value.trusted_service_access_enabled, null)

      dynamic "virtual_network_rule" {
        for_each = try(var.settings.network_rulesets.virtual_network_rule, {})
        content {
          subnet_id                                       = virtual_network_rule.value.subnet_id
          ignore_missing_virtual_network_service_endpoint = try(virtual_network_rule.value.ignore_missing_virtual_network_service_endpoint, null)
        }
      }

      dynamic "ip_rule" {
        for_each = try(var.settings.network_rulesets.ip_rule, {})
        content {
          ip_mask = ip_rule.value.ip_mask
          action  = try(ip_rule.value.action, null)
        }
      }
    }
  }

}

Steps to Reproduce

use given config

Already fixed it, will provide PR

Important Factoids

No response

References

No response

@arne21a arne21a added the bug Something isn't working label Dec 1, 2023
@arnaudlh arnaudlh added this to 2401 Jan 5, 2024
@arnaudlh arnaudlh added this to the 5.7.8 milestone Jan 5, 2024
@arnaudlh arnaudlh linked a pull request Jan 5, 2024 that will close this issue
6 tasks
arnaudlh added a commit that referenced this issue Jan 5, 2024
…b_namespace-network_rulesets

fix(azurerm_eventhub_namespace): fixing for_each reference
@github-project-automation github-project-automation bot moved this to Done in 2401 Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working eventhub
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants