diff --git a/quickstart/201-azfw-with-ipgroups/main.tf b/quickstart/201-azfw-with-ipgroups/main.tf index 3bdf6f8c..4c645cd2 100644 --- a/quickstart/201-azfw-with-ipgroups/main.tf +++ b/quickstart/201-azfw-with-ipgroups/main.tf @@ -49,42 +49,36 @@ resource "azurerm_firewall_policy" "azfw_policy" { threat_intelligence_mode = "Alert" } -resource "azurerm_firewall_policy_rule_collection_group" "net_policy_rule_collection_group" { - name = "DefaultNetworkRuleCollectionGroup" - firewall_policy_id = azurerm_firewall_policy.azfw_policy.id - priority = 200 - network_rule_collection { - name = "DefaultNetworkRuleCollection" - action = "Allow" - priority = 200 - rule { - name = "networkRule" - protocols = ["Any"] - destination_ip_groups = [azurerm_ip_group.ip_group_2.id] - destination_ports = ["90"] - source_ip_groups = [azurerm_ip_group.ip_group_1.id] - } - } -} - -resource "azurerm_firewall_policy_rule_collection_group" "app_policy_rule_collection_group" { - name = "DefaulApplicationtRuleCollectionGroup" - firewall_policy_id = azurerm_firewall_policy.azfw_policy.id - priority = 300 - application_rule_collection { - name = "DefaultApplicationRuleCollection" - action = "Allow" - priority = 500 - rule { - name = "SomeAppRule" - protocols { - type = "Http" - port = 8080 +resource "azurerm_firewall_policy_rule_collection_group" "prcg" { + name = "prcg" + firewall_policy_id = azurerm_firewall_policy.azfw_policy.id + priority = 300 + application_rule_collection { + name = "app-rule-collection-1" + priority = 101 + action = "Allow" + rule { + name = "someAppRule" + protocols { + type = "Https" + port = 443 + } + destination_fqdns = [ "*bing.com" ] + source_ip_groups = [ azurerm_ip_group.ip_group_1.id ] + } + } + network_rule_collection { + name = "net-rule-collection-1" + priority = 200 + action = "Allow" + rule { + name = "someNetRule" + protocols = [ "TCP", "UDP", "ICMP" ] + source_ip_groups = [ azurerm_ip_group.ip_group_1.id ] + destination_ip_groups = [ azurerm_ip_group.ip_group_2.id ] + destination_ports = ["90"] } - source_ip_groups = [azurerm_ip_group.ip_group_1.id] - destination_fqdns = ["*bing.com"] } - } } resource "azurerm_firewall" "fw" { @@ -129,7 +123,7 @@ resource "azurerm_subnet" "azfw_subnet" { } resource "azurerm_subnet" "server_subnet" { - name = "subnet-workload" + name = "subnet-server" resource_group_name = azurerm_resource_group.rg.name virtual_network_name = azurerm_virtual_network.azfw_vnet.name address_prefixes = ["10.10.1.0/24"] diff --git a/quickstart/201-azfw-with-ipgroups/readme.md b/quickstart/201-azfw-with-ipgroups/readme.md index 8d9aec20..85a8b9a7 100644 --- a/quickstart/201-azfw-with-ipgroups/readme.md +++ b/quickstart/201-azfw-with-ipgroups/readme.md @@ -14,7 +14,7 @@ This template deploys an [Azure Firewall](https://registry.terraform.io/provider - [azurerm_firewall](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/firewall) - [azurerm_network_interface](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface) - [azurerm_network_security_group](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_security_group) -- [azurerm_network_interface_security_group_association](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface_security_group_association +- [azurerm_network_interface_security_group_association](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/network_interface_security_group_association) - [azurerm_route_table](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/route_table) - [azurerm_subnet_route_table_association](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_route_table_association) - [azurerm_linux_virtual_machine](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_virtual_machine) diff --git a/quickstart/201-azfw-with-ipgroups/variables.tf b/quickstart/201-azfw-with-ipgroups/variables.tf index 2b836925..a855798d 100644 --- a/quickstart/201-azfw-with-ipgroups/variables.tf +++ b/quickstart/201-azfw-with-ipgroups/variables.tf @@ -28,10 +28,4 @@ variable "virtual_machine_size" { variable "admin_username" { default = "azureuser" -} - -variable "storage_name" { - type = string - description = "value of the storage account name" - default = "azfwteststgacctipg" } \ No newline at end of file