Skip to main content
Providers

Vnet

A resource of the Azure provider, version 0.3.0, in its Networking group. Import it with:

import Vnet from "azure/networking"

Example

resource Vnet example {
    name                 = "example-value"
    resourceGroup        = "example-value"
    location             = "example-value"
    addressSpaces        = "..."
    dnsServers           = "..."
    enableDdosProtection = false
    enableVmProtection   = false
    tags                 = "..."
}

Properties

Set by your code in the resource block. A required one must be set; any other you leave out takes the value under Default, if it has one.

NameTypeDefaultRequiredDescription
namestring—NoThe name of the virtual network
resourceGroupstring—NoThe Azure resource group name
locationstring—NoThe Azure region/location (e.g., eastus, westeurope)
addressSpacesany[]—NoThe address spaces for the VNet in CIDR notation
dnsServersany[]—NoCustom DNS servers for the VNet. If not specified, Azure-provided DNS is used
enableDdosProtectionbooleanfalseNoEnable DDoS protection for the VNet
enableVmProtectionbooleanfalseNoEnable VM protection for the VNet
tagsobject—NoTags to apply to the VNet

Set by Azure after the resource is created: your code can read them but not set them. An importable one identifies an existing resource.

NameTypeImportableDescription
idstringYesThe Azure resource ID of the VNet
provisioningStatestringNoThe provisioning state of the VNet
resourceGuidstringNoThe resource GUID of the VNet
hasSubnetsbooleanNoWhether the VNet has any subnets

On this page