The following arguments are supported:
NOTE
The as-number segment is the Microsoft ASN, which is always 12076 for now.
NOTE
Since dns_servers can be configured both inline and via the separate azurerm_virtual_network_dns_servers resource, we have to explicitly set it to empty slice ([]) to remove it.
NOTE
Since subnet can be configured both inline and via the separate azurerm_subnet resource, we have to explicitly set it to empty slice ([]) to remove it.
A ddos_protection_plan block supports the following:
The subnet block supports:
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_network_security_group" "example" {
name = "example-security-group"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
}
resource "azurerm_virtual_network" "example" {
name = "example-network"
location = azurerm_resource_group.example.location
resource_group_name = azurerm_resource_group.example.name
address_space = ["10.0.0.0/16"]
dns_servers = ["10.0.0.4", "10.0.0.5"]
subnet {
name = "subnet1"
address_prefix = "10.0.1.0/24"
}
subnet {
name = "subnet2"
address_prefix = "10.0.2.0/24"
security_group = azurerm_network_security_group.example.id
}
tags = {
environment = "Production"
}
}
az network vnet create --name
--resource-group
[--address-prefixes]
[--bgp-community]
[--ddos-protection {0, 1, f, false, n, no, t, true, y, yes}]
[--ddos-protection-plan]
[--dns-servers]
[--edge-zone]
[--enable-encryption {0, 1, f, false, n, no, t, true, y, yes}]
[--encryption-enforcement-policy {AllowUnencrypted, DropUnencrypted}]
[--flowtimeout]
[--location]
[--network-security-group]
[--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
[--subnet-name]
[--subnet-prefixes]
[--subnets]
[--tags]
[--vm-protection {0, 1, f, false, n, no, t, true, y, yes}]
az network vnet create -g MyResourceGroup -n MyVnet --address-prefix 10.0.0.0/16 --subnet-name MySubnet --subnet-prefixes 10.0.0.0/24
Categorized by Availability, Security & Compliance and Cost