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.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
name | string | — | No | The name of the subnet |
resourceGroup | string | — | No | The Azure resource group name |
vnetName | string | — | No | The name of the parent Virtual Network |
addressPrefix | string | — | No | The address prefix for the subnet in CIDR notation (e.g., 10.0.1.0/24) |
networkSecurityGroupId | string | — | No | The ID of the Network Security Group to associate |
routeTableId | string | — | No | The ID of the Route Table to associate |
privateEndpointNetworkPolicies | boolean | true | No | Enable private endpoint network policies |
privateLinkServiceNetworkPolicies | boolean | true | No | Enable private link service network policies |
serviceEndpoints | any[] | — | No | Service 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.
| Name | Type | Importable | Description |
|---|---|---|---|
id | string | Yes | The Azure resource ID of the subnet |
provisioningState | string | No | The provisioning state of the subnet |
purpose | string | No | The purpose of the subnet (e.g., for private endpoints) |