The following arguments are supported:
A application_rule_collection block supports the following:
A network_rule_collection block supports the following:
A nat_rule_collection block supports the following:
A application_rule (application rule) block supports the following:
A network_rule (network rule) block supports the following:
A nat_rule (NAT rule) block supports the following:
NOTE:
Exactly one of translated_address and translated_fqdn should be set.
A protocols block supports the following:
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_firewall_policy" "example" {
name = "example-fwpolicy"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
}
resource "azurerm_firewall_policy_rule_collection_group" "example" {
name = "example-fwpolicy-rcg"
firewall_policy_id = azurerm_firewall_policy.example.id
priority = 500
application_rule_collection {
name = "app_rule_collection1"
priority = 500
action = "Deny"
rule {
name = "app_rule_collection1_rule1"
protocols {
type = "Http"
port = 80
}
protocols {
type = "Https"
port = 443
}
source_addresses = ["10.0.0.1"]
destination_fqdns = ["*.microsoft.com"]
}
}
network_rule_collection {
name = "network_rule_collection1"
priority = 400
action = "Deny"
rule {
name = "network_rule_collection1_rule1"
protocols = ["TCP", "UDP"]
source_addresses = ["10.0.0.1"]
destination_addresses = ["192.168.1.1", "192.168.1.2"]
destination_ports = ["80", "1000-2000"]
}
}
nat_rule_collection {
name = "nat_rule_collection1"
priority = 300
action = "Dnat"
rule {
name = "nat_rule_collection1_rule1"
protocols = ["TCP", "UDP"]
source_addresses = ["10.0.0.1", "10.0.0.2"]
destination_address = "192.168.1.1"
destination_ports = ["80"]
translated_address = "192.168.0.1"
translated_port = "8080"
}
}
}
az network firewall policy rule-collection-group create --name
--policy-name
--priority
--resource-group
az network firewall policy rule-collection-group create --collection-name "WebTrafficRules" --priority 100 --action "Allow" --rule-name "Allow-HTTP" --protocols "Http=80" --destination-addresses "10.0.0.0/24" --destination-ports "*" --firewall-policy-name "MyFirewallPolicy" --resource-group "MyResourceGroup"
Categorized by Availability, Security & Compliance and Cost