Azure Firewall – Terraform
Ortamınızda Azure Firewall’u Terraform ile dağıtmak için aşağıdaki örnek kodu kullanabilirsiniz.
resource "azurerm_resource_group" "msazureturkey" {
name = "msazureturkey-resources"
location = "North Europe"
}
resource "azurerm_virtual_network" "msazureturkey" {
name = "msazureturkeyvnet"
address_space = ["10.0.0.0/16"]
location = azurerm_resource_group.msazureturkey.location
resource_group_name = azurerm_resource_group.msazureturkey.name
}
resource "azurerm_subnet" "msazureturkey" {
name = "AzureFirewallSubnet"
resource_group_name = azurerm_resource_group.msazureturkey.name
virtual_network_name = azurerm_virtual_network.msazureturkey.name
address_prefixes = ["10.0.1.0/24"]
}
resource "azurerm_public_ip" "msazureturkey" {
name = "msazureturkeypip"
location = azurerm_resource_group.msazureturkey.location
resource_group_name = azurerm_resource_group.msazureturkey.name
allocation_method = "Static"
sku = "Standard"
}
resource "azurerm_firewall" "msazureturkey" {
name = "msazureturkeyfirewall"
location = azurerm_resource_group.msazureturkey.location
resource_group_name = azurerm_resource_group.msazureturkey.name
sku_name = "AZFW_VNet"
sku_tier = "Standard"
ip_configuration {
name = "configuration"
subnet_id = azurerm_subnet.msazureturkey.id
public_ip_address_id = azurerm_public_ip.msazureturkey.id
}
}