Skip to main content
Providers

Subnet

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

import Subnet from "azure/networking"

Example

resource Subnet example {
    name                              = "example-value"
    resourceGroup                     = "example-value"
    vnetName                          = "example-value"
    addressPrefix                     = "example-value"
    networkSecurityGroupId            = "example-value"
    routeTableId                      = "example-value"
    privateEndpointNetworkPolicies    = true
    privateLinkServiceNetworkPolicies = true
    serviceEndpoints                  = "..."
}

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 subnet
resourceGroupstring—NoThe Azure resource group name
vnetNamestring—NoThe name of the parent Virtual Network
addressPrefixstring—NoThe address prefix for the subnet in CIDR notation (e.g., 10.0.1.0/24)
networkSecurityGroupIdstring—NoThe ID of the Network Security Group to associate
routeTableIdstring—NoThe ID of the Route Table to associate
privateEndpointNetworkPoliciesbooleantrueNoEnable private endpoint network policies
privateLinkServiceNetworkPoliciesbooleantrueNoEnable private link service network policies
serviceEndpointsany[]—NoService endpoints to enable (e.g., Microsoft.Storage, Microsoft.Sql)

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 subnet
provisioningStatestringNoThe provisioning state of the subnet
purposestringNoThe purpose of the subnet (e.g., for private endpoints)

On this page