Skip to content

A module used to help simpify the network firewall rules within a Azure Firewall 🧱✅

License

Notifications You must be signed in to change notification settings

cyber-scot/terraform-azurerm-firewall-network-rules

 
 

Repository files navigation

resource "azurerm_firewall_network_rule_collection" "network_rules" {
  for_each = { for k, v in var.network_rule_collections : k => v }

  name                = each.value.name
  azure_firewall_name = var.firewall_name
  resource_group_name = var.rg_name
  priority            = each.value.priority
  action              = title(each.value.action)

  dynamic "rule" {
    for_each = each.value.rules
    content {
      name                  = rule.value.name
      protocols             = upper(rule.value.protocols)
      description           = rule.value.description
      source_addresses      = rule.value.source_addresses
      source_ip_groups      = rule.value.source_ip_groups
      destination_addresses = rule.value.destination_addresses
      destination_ports     = rule.value.destination_ports
      destination_ip_groups = rule.value.destination_ip_groups
      destination_fqdns     = rule.value.destination_fqdns
    }
  }
}

Requirements

No requirements.

Providers

Name Version
azurerm n/a

Modules

No modules.

Resources

Name Type
azurerm_firewall_network_rule_collection.network_rules resource

Inputs

Name Description Type Default Required
firewall_name The name of the Azure firewall this rule collection should be added to string n/a yes
network_rule_collections A list of network rule collections, each containing a list of network rules.
list(object({
name = string
action = string
priority = number
rules = list(object({
name = string
description = optional(string)
destination_addresses = optional(list(string))
destination_ports = list(string)
destination_ip_groups = optional(list(string))
protocols = list(string)
source_addresses = optional(list(string))
source_ip_groups = optional(list(string))
destination_fqdns = optional(list(string))
}))
}))
[] no
rg_name The name of the resource group the Azure firewall resides within string n/a yes

Outputs

Name Description
network_rule_collections_output The network rule collections created by the module.
network_rule_ids The IDs of the network rule collections.
network_rule_names The names of the network rule collections.
network_rules Details of the network rules within each collection.

About

A module used to help simpify the network firewall rules within a Azure Firewall 🧱✅

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 53.1%
  • HCL 46.9%