Skip to content

Commit

Permalink
add network ruleset config, pre-commit fix
Browse files Browse the repository at this point in the history
  • Loading branch information
KoomeKiriinya committed Mar 6, 2024
1 parent 5604988 commit 5ac7117
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions modules/azure/event-hubs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ resource "azurerm_eventhub_namespace" "events" {
dynamic "network_rulesets" {
for_each = each.value.network_rules != null ? ["true"] : []
content {
default_action = "Deny"

default_action = "Deny"
public_network_access_enabled = each.value.public_network_access_enabled
trusted_service_access_enabled = each.value.trusted_service_access_enabled
dynamic "ip_rule" {
for_each = each.value.network_rules.ip_rules
iterator = iprule
Expand All @@ -41,7 +42,8 @@ resource "azurerm_eventhub_namespace" "events" {
for_each = each.value.network_rules.subnet_ids
iterator = subnet
content {
subnet_id = subnet.value
ignore_missing_virtual_network_service_endpoint = false
subnet_id = subnet.value
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions modules/azure/event-hubs/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@ variable "event_hubs_namespaces" {
maximum_throughput_units = optional(number)
})
network_rules = optional(object({
ip_rules = list(string)
subnet_ids = list(string)
ip_rules = optional(list(string), [""])
subnet_ids = optional(list(string), [""])
public_network_access_enabled = optional(bool, false)
trusted_service_access_enabled = optional(bool, false)
}))
private_endpoint = optional(object({
enabled = optional(bool, false)
Expand Down

0 comments on commit 5ac7117

Please sign in to comment.