We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
Manages a virtual network including any configured subnets. Each subnet can optionally be configured with a security group to be associated with the subnet.
NOTE on Virtual Networks and Subnet’s: This provider currently provides both a standalone Subnet resource, and allows for Subnets to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line Subnets in conjunction with any Subnet resources. Doing so will cause a conflict of Subnet configurations and will overwrite Subnet’s. NOTE on Virtual Networks and DNS Servers: This provider currently provides both a standalone virtual network DNS Servers resource, and allows for DNS servers to be defined in-line within the Virtual Network resource. At this time you cannot use a Virtual Network with in-line DNS servers in conjunction with any Virtual Network DNS Servers resources. Doing so will cause a conflict of Virtual Network DNS Servers configurations and will overwrite virtual networks DNS servers.
Example Usage
using Pulumi;
using Azure = Pulumi.Azure;
class MyStack : Stack
{
public MyStack()
{
var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new Azure.Core.ResourceGroupArgs
{
Location = "West Europe",
});
var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new Azure.Network.NetworkSecurityGroupArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
});
var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new Azure.Network.VirtualNetworkArgs
{
Location = exampleResourceGroup.Location,
ResourceGroupName = exampleResourceGroup.Name,
AddressSpaces =
{
"10.0.0.0/16",
},
DnsServers =
{
"10.0.0.4",
"10.0.0.5",
},
Subnets =
{
new Azure.Network.Inputs.VirtualNetworkSubnetArgs
{
Name = "subnet1",
AddressPrefix = "10.0.1.0/24",
},
new Azure.Network.Inputs.VirtualNetworkSubnetArgs
{
Name = "subnet2",
AddressPrefix = "10.0.2.0/24",
SecurityGroup = exampleNetworkSecurityGroup.Id,
},
},
Tags =
{
{ "environment", "Production" },
},
});
}
}
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/network"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleNetworkSecurityGroup, err := network.NewNetworkSecurityGroup(ctx, "exampleNetworkSecurityGroup", &network.NetworkSecurityGroupArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
})
if err != nil {
return err
}
_, err = network.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &network.VirtualNetworkArgs{
Location: exampleResourceGroup.Location,
ResourceGroupName: exampleResourceGroup.Name,
AddressSpaces: pulumi.StringArray{
pulumi.String("10.0.0.0/16"),
},
DnsServers: pulumi.StringArray{
pulumi.String("10.0.0.4"),
pulumi.String("10.0.0.5"),
},
Subnets: network.VirtualNetworkSubnetArray{
&network.VirtualNetworkSubnetArgs{
Name: pulumi.String("subnet1"),
AddressPrefix: pulumi.String("10.0.1.0/24"),
},
&network.VirtualNetworkSubnetArgs{
Name: pulumi.String("subnet2"),
AddressPrefix: pulumi.String("10.0.2.0/24"),
SecurityGroup: exampleNetworkSecurityGroup.ID(),
},
},
Tags: pulumi.StringMap{
"environment": pulumi.String("Production"),
},
})
if err != nil {
return err
}
return nil
})
}
Example coming soon!
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleNetworkSecurityGroup = new azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
});
const exampleVirtualNetwork = new azure.network.VirtualNetwork("exampleVirtualNetwork", {
location: exampleResourceGroup.location,
resourceGroupName: exampleResourceGroup.name,
addressSpaces: ["10.0.0.0/16"],
dnsServers: [
"10.0.0.4",
"10.0.0.5",
],
subnets: [
{
name: "subnet1",
addressPrefix: "10.0.1.0/24",
},
{
name: "subnet2",
addressPrefix: "10.0.2.0/24",
securityGroup: exampleNetworkSecurityGroup.id,
},
],
tags: {
environment: "Production",
},
});
import pulumi
import pulumi_azure as azure
example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_network_security_group = azure.network.NetworkSecurityGroup("exampleNetworkSecurityGroup",
location=example_resource_group.location,
resource_group_name=example_resource_group.name)
example_virtual_network = azure.network.VirtualNetwork("exampleVirtualNetwork",
location=example_resource_group.location,
resource_group_name=example_resource_group.name,
address_spaces=["10.0.0.0/16"],
dns_servers=[
"10.0.0.4",
"10.0.0.5",
],
subnets=[
azure.network.VirtualNetworkSubnetArgs(
name="subnet1",
address_prefix="10.0.1.0/24",
),
azure.network.VirtualNetworkSubnetArgs(
name="subnet2",
address_prefix="10.0.2.0/24",
security_group=example_network_security_group.id,
),
],
tags={
"environment": "Production",
})
Example coming soon!
Create VirtualNetwork Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new VirtualNetwork(name: string, args: VirtualNetworkArgs, opts?: CustomResourceOptions);@overload
def VirtualNetwork(resource_name: str,
args: VirtualNetworkArgs,
opts: Optional[ResourceOptions] = None)
@overload
def VirtualNetwork(resource_name: str,
opts: Optional[ResourceOptions] = None,
address_spaces: Optional[Sequence[str]] = None,
resource_group_name: Optional[str] = None,
bgp_community: Optional[str] = None,
ddos_protection_plan: Optional[VirtualNetworkDdosProtectionPlanArgs] = None,
dns_servers: Optional[Sequence[str]] = None,
flow_timeout_in_minutes: Optional[int] = None,
location: Optional[str] = None,
name: Optional[str] = None,
subnets: Optional[Sequence[VirtualNetworkSubnetArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
vm_protection_enabled: Optional[bool] = None)func NewVirtualNetwork(ctx *Context, name string, args VirtualNetworkArgs, opts ...ResourceOption) (*VirtualNetwork, error)public VirtualNetwork(string name, VirtualNetworkArgs args, CustomResourceOptions? opts = null)
public VirtualNetwork(String name, VirtualNetworkArgs args)
public VirtualNetwork(String name, VirtualNetworkArgs args, CustomResourceOptions options)
type: azure:network:VirtualNetwork
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args VirtualNetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args VirtualNetworkArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args VirtualNetworkArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args VirtualNetworkArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args VirtualNetworkArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var azureVirtualNetworkResource = new Azure.Network.VirtualNetwork("azureVirtualNetworkResource", new()
{
AddressSpaces = new[]
{
"string",
},
ResourceGroupName = "string",
BgpCommunity = "string",
DdosProtectionPlan = new Azure.Network.Inputs.VirtualNetworkDdosProtectionPlanArgs
{
Enable = false,
Id = "string",
},
DnsServers = new[]
{
"string",
},
FlowTimeoutInMinutes = 0,
Location = "string",
Name = "string",
Subnets = new[]
{
new Azure.Network.Inputs.VirtualNetworkSubnetArgs
{
AddressPrefix = "string",
Name = "string",
Id = "string",
SecurityGroup = "string",
},
},
Tags =
{
{ "string", "string" },
},
});
example, err := network.NewVirtualNetwork(ctx, "azureVirtualNetworkResource", &network.VirtualNetworkArgs{
AddressSpaces: pulumi.StringArray{
pulumi.String("string"),
},
ResourceGroupName: pulumi.String("string"),
BgpCommunity: pulumi.String("string"),
DdosProtectionPlan: &network.VirtualNetworkDdosProtectionPlanArgs{
Enable: pulumi.Bool(false),
Id: pulumi.String("string"),
},
DnsServers: pulumi.StringArray{
pulumi.String("string"),
},
FlowTimeoutInMinutes: pulumi.Int(0),
Location: pulumi.String("string"),
Name: pulumi.String("string"),
Subnets: network.VirtualNetworkSubnetArray{
&network.VirtualNetworkSubnetArgs{
AddressPrefix: pulumi.String("string"),
Name: pulumi.String("string"),
Id: pulumi.String("string"),
SecurityGroup: pulumi.String("string"),
},
},
Tags: pulumi.StringMap{
"string": pulumi.String("string"),
},
})
var azureVirtualNetworkResource = new com.pulumi.azure.network.VirtualNetwork("azureVirtualNetworkResource", com.pulumi.azure.network.VirtualNetworkArgs.builder()
.addressSpaces("string")
.resourceGroupName("string")
.bgpCommunity("string")
.ddosProtectionPlan(VirtualNetworkDdosProtectionPlanArgs.builder()
.enable(false)
.id("string")
.build())
.dnsServers("string")
.flowTimeoutInMinutes(0)
.location("string")
.name("string")
.subnets(VirtualNetworkSubnetArgs.builder()
.addressPrefix("string")
.name("string")
.id("string")
.securityGroup("string")
.build())
.tags(Map.of("string", "string"))
.build());
azure_virtual_network_resource = azure.network.VirtualNetwork("azureVirtualNetworkResource",
address_spaces=["string"],
resource_group_name="string",
bgp_community="string",
ddos_protection_plan={
"enable": False,
"id": "string",
},
dns_servers=["string"],
flow_timeout_in_minutes=0,
location="string",
name="string",
subnets=[{
"address_prefix": "string",
"name": "string",
"id": "string",
"security_group": "string",
}],
tags={
"string": "string",
})
const azureVirtualNetworkResource = new azure.network.VirtualNetwork("azureVirtualNetworkResource", {
addressSpaces: ["string"],
resourceGroupName: "string",
bgpCommunity: "string",
ddosProtectionPlan: {
enable: false,
id: "string",
},
dnsServers: ["string"],
flowTimeoutInMinutes: 0,
location: "string",
name: "string",
subnets: [{
addressPrefix: "string",
name: "string",
id: "string",
securityGroup: "string",
}],
tags: {
string: "string",
},
});
type: azure:network:VirtualNetwork
properties:
addressSpaces:
- string
bgpCommunity: string
ddosProtectionPlan:
enable: false
id: string
dnsServers:
- string
flowTimeoutInMinutes: 0
location: string
name: string
resourceGroupName: string
subnets:
- addressPrefix: string
id: string
name: string
securityGroup: string
tags:
string: string
VirtualNetwork Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The VirtualNetwork resource accepts the following input properties:
- Address
Spaces List<string> - The address space that is used the virtual network. You can supply more than one address space.
- Resource
Group stringName - The name of the resource group in which to create the virtual network.
- Bgp
Community string - The BGP community attribute in format
<as-number>:<community-value>. - Ddos
Protection VirtualPlan Network Ddos Protection Plan - A
ddos_protection_planblock as documented below. - Dns
Servers List<string> - List of IP addresses of DNS servers
- Flow
Timeout intIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - Location string
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- Name string
- The name of the virtual network. Changing this forces a new resource to be created.
- Subnets
List<Virtual
Network Subnet> - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Vm
Protection boolEnabled
- Address
Spaces []string - The address space that is used the virtual network. You can supply more than one address space.
- Resource
Group stringName - The name of the resource group in which to create the virtual network.
- Bgp
Community string - The BGP community attribute in format
<as-number>:<community-value>. - Ddos
Protection VirtualPlan Network Ddos Protection Plan Args - A
ddos_protection_planblock as documented below. - Dns
Servers []string - List of IP addresses of DNS servers
- Flow
Timeout intIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - Location string
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- Name string
- The name of the virtual network. Changing this forces a new resource to be created.
- Subnets
[]Virtual
Network Subnet Args - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - map[string]string
- A mapping of tags to assign to the resource.
- Vm
Protection boolEnabled
- address
Spaces List<String> - The address space that is used the virtual network. You can supply more than one address space.
- resource
Group StringName - The name of the resource group in which to create the virtual network.
- bgp
Community String - The BGP community attribute in format
<as-number>:<community-value>. - ddos
Protection VirtualPlan Network Ddos Protection Plan - A
ddos_protection_planblock as documented below. - dns
Servers List<String> - List of IP addresses of DNS servers
- flow
Timeout IntegerIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - location String
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name String
- The name of the virtual network. Changing this forces a new resource to be created.
- subnets
List<Virtual
Network Subnet> - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Map<String,String>
- A mapping of tags to assign to the resource.
- vm
Protection BooleanEnabled
- address
Spaces string[] - The address space that is used the virtual network. You can supply more than one address space.
- resource
Group stringName - The name of the resource group in which to create the virtual network.
- bgp
Community string - The BGP community attribute in format
<as-number>:<community-value>. - ddos
Protection VirtualPlan Network Ddos Protection Plan - A
ddos_protection_planblock as documented below. - dns
Servers string[] - List of IP addresses of DNS servers
- flow
Timeout numberIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - location string
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name string
- The name of the virtual network. Changing this forces a new resource to be created.
- subnets
Virtual
Network Subnet[] - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- vm
Protection booleanEnabled
- address_
spaces Sequence[str] - The address space that is used the virtual network. You can supply more than one address space.
- resource_
group_ strname - The name of the resource group in which to create the virtual network.
- bgp_
community str - The BGP community attribute in format
<as-number>:<community-value>. - ddos_
protection_ Virtualplan Network Ddos Protection Plan Args - A
ddos_protection_planblock as documented below. - dns_
servers Sequence[str] - List of IP addresses of DNS servers
- flow_
timeout_ intin_ minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - location str
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name str
- The name of the virtual network. Changing this forces a new resource to be created.
- subnets
Sequence[Virtual
Network Subnet Args] - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- vm_
protection_ boolenabled
- address
Spaces List<String> - The address space that is used the virtual network. You can supply more than one address space.
- resource
Group StringName - The name of the resource group in which to create the virtual network.
- bgp
Community String - The BGP community attribute in format
<as-number>:<community-value>. - ddos
Protection Property MapPlan - A
ddos_protection_planblock as documented below. - dns
Servers List<String> - List of IP addresses of DNS servers
- flow
Timeout NumberIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - location String
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name String
- The name of the virtual network. Changing this forces a new resource to be created.
- subnets List<Property Map>
- Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Map<String>
- A mapping of tags to assign to the resource.
- vm
Protection BooleanEnabled
Outputs
All input properties are implicitly available as output properties. Additionally, the VirtualNetwork resource produces the following output properties:
Look up Existing VirtualNetwork Resource
Get an existing VirtualNetwork resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: VirtualNetworkState, opts?: CustomResourceOptions): VirtualNetwork@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
address_spaces: Optional[Sequence[str]] = None,
bgp_community: Optional[str] = None,
ddos_protection_plan: Optional[VirtualNetworkDdosProtectionPlanArgs] = None,
dns_servers: Optional[Sequence[str]] = None,
flow_timeout_in_minutes: Optional[int] = None,
guid: Optional[str] = None,
location: Optional[str] = None,
name: Optional[str] = None,
resource_group_name: Optional[str] = None,
subnets: Optional[Sequence[VirtualNetworkSubnetArgs]] = None,
tags: Optional[Mapping[str, str]] = None,
vm_protection_enabled: Optional[bool] = None) -> VirtualNetworkfunc GetVirtualNetwork(ctx *Context, name string, id IDInput, state *VirtualNetworkState, opts ...ResourceOption) (*VirtualNetwork, error)public static VirtualNetwork Get(string name, Input<string> id, VirtualNetworkState? state, CustomResourceOptions? opts = null)public static VirtualNetwork get(String name, Output<String> id, VirtualNetworkState state, CustomResourceOptions options)resources: _: type: azure:network:VirtualNetwork get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Address
Spaces List<string> - The address space that is used the virtual network. You can supply more than one address space.
- Bgp
Community string - The BGP community attribute in format
<as-number>:<community-value>. - Ddos
Protection VirtualPlan Network Ddos Protection Plan - A
ddos_protection_planblock as documented below. - Dns
Servers List<string> - List of IP addresses of DNS servers
- Flow
Timeout intIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - Guid string
- The GUID of the virtual network.
- Location string
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- Name string
- The name of the virtual network. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the virtual network.
- Subnets
List<Virtual
Network Subnet> - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Dictionary<string, string>
- A mapping of tags to assign to the resource.
- Vm
Protection boolEnabled
- Address
Spaces []string - The address space that is used the virtual network. You can supply more than one address space.
- Bgp
Community string - The BGP community attribute in format
<as-number>:<community-value>. - Ddos
Protection VirtualPlan Network Ddos Protection Plan Args - A
ddos_protection_planblock as documented below. - Dns
Servers []string - List of IP addresses of DNS servers
- Flow
Timeout intIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - Guid string
- The GUID of the virtual network.
- Location string
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- Name string
- The name of the virtual network. Changing this forces a new resource to be created.
- Resource
Group stringName - The name of the resource group in which to create the virtual network.
- Subnets
[]Virtual
Network Subnet Args - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - map[string]string
- A mapping of tags to assign to the resource.
- Vm
Protection boolEnabled
- address
Spaces List<String> - The address space that is used the virtual network. You can supply more than one address space.
- bgp
Community String - The BGP community attribute in format
<as-number>:<community-value>. - ddos
Protection VirtualPlan Network Ddos Protection Plan - A
ddos_protection_planblock as documented below. - dns
Servers List<String> - List of IP addresses of DNS servers
- flow
Timeout IntegerIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - guid String
- The GUID of the virtual network.
- location String
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name String
- The name of the virtual network. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the virtual network.
- subnets
List<Virtual
Network Subnet> - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Map<String,String>
- A mapping of tags to assign to the resource.
- vm
Protection BooleanEnabled
- address
Spaces string[] - The address space that is used the virtual network. You can supply more than one address space.
- bgp
Community string - The BGP community attribute in format
<as-number>:<community-value>. - ddos
Protection VirtualPlan Network Ddos Protection Plan - A
ddos_protection_planblock as documented below. - dns
Servers string[] - List of IP addresses of DNS servers
- flow
Timeout numberIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - guid string
- The GUID of the virtual network.
- location string
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name string
- The name of the virtual network. Changing this forces a new resource to be created.
- resource
Group stringName - The name of the resource group in which to create the virtual network.
- subnets
Virtual
Network Subnet[] - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - {[key: string]: string}
- A mapping of tags to assign to the resource.
- vm
Protection booleanEnabled
- address_
spaces Sequence[str] - The address space that is used the virtual network. You can supply more than one address space.
- bgp_
community str - The BGP community attribute in format
<as-number>:<community-value>. - ddos_
protection_ Virtualplan Network Ddos Protection Plan Args - A
ddos_protection_planblock as documented below. - dns_
servers Sequence[str] - List of IP addresses of DNS servers
- flow_
timeout_ intin_ minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - guid str
- The GUID of the virtual network.
- location str
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name str
- The name of the virtual network. Changing this forces a new resource to be created.
- resource_
group_ strname - The name of the resource group in which to create the virtual network.
- subnets
Sequence[Virtual
Network Subnet Args] - Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Mapping[str, str]
- A mapping of tags to assign to the resource.
- vm_
protection_ boolenabled
- address
Spaces List<String> - The address space that is used the virtual network. You can supply more than one address space.
- bgp
Community String - The BGP community attribute in format
<as-number>:<community-value>. - ddos
Protection Property MapPlan - A
ddos_protection_planblock as documented below. - dns
Servers List<String> - List of IP addresses of DNS servers
- flow
Timeout NumberIn Minutes - The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between
4and30minutes. - guid String
- The GUID of the virtual network.
- location String
- The location/region where the virtual network is created. Changing this forces a new resource to be created.
- name String
- The name of the virtual network. Changing this forces a new resource to be created.
- resource
Group StringName - The name of the resource group in which to create the virtual network.
- subnets List<Property Map>
- Can be specified multiple times to define multiple subnets. Each
subnetblock supports fields documented below. - Map<String>
- A mapping of tags to assign to the resource.
- vm
Protection BooleanEnabled
Supporting Types
VirtualNetworkDdosProtectionPlan, VirtualNetworkDdosProtectionPlanArgs
VirtualNetworkSubnet, VirtualNetworkSubnetArgs
- Address
Prefix string - The address prefix to use for the subnet.
- Name string
- The name of the virtual network. Changing this forces a new resource to be created.
- Id string
- The ID of DDoS Protection Plan.
- Security
Group string - The Network Security Group to associate with the subnet. (Referenced by
id, ie.azurerm_network_security_group.example.id)
- Address
Prefix string - The address prefix to use for the subnet.
- Name string
- The name of the virtual network. Changing this forces a new resource to be created.
- Id string
- The ID of DDoS Protection Plan.
- Security
Group string - The Network Security Group to associate with the subnet. (Referenced by
id, ie.azurerm_network_security_group.example.id)
- address
Prefix String - The address prefix to use for the subnet.
- name String
- The name of the virtual network. Changing this forces a new resource to be created.
- id String
- The ID of DDoS Protection Plan.
- security
Group String - The Network Security Group to associate with the subnet. (Referenced by
id, ie.azurerm_network_security_group.example.id)
- address
Prefix string - The address prefix to use for the subnet.
- name string
- The name of the virtual network. Changing this forces a new resource to be created.
- id string
- The ID of DDoS Protection Plan.
- security
Group string - The Network Security Group to associate with the subnet. (Referenced by
id, ie.azurerm_network_security_group.example.id)
- address_
prefix str - The address prefix to use for the subnet.
- name str
- The name of the virtual network. Changing this forces a new resource to be created.
- id str
- The ID of DDoS Protection Plan.
- security_
group str - The Network Security Group to associate with the subnet. (Referenced by
id, ie.azurerm_network_security_group.example.id)
- address
Prefix String - The address prefix to use for the subnet.
- name String
- The name of the virtual network. Changing this forces a new resource to be created.
- id String
- The ID of DDoS Protection Plan.
- security
Group String - The Network Security Group to associate with the subnet. (Referenced by
id, ie.azurerm_network_security_group.example.id)
Import
Virtual Networks can be imported using the resource id, e.g.
$ pulumi import azure:network/virtualNetwork:VirtualNetwork exampleNetwork /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Network/virtualNetworks/myvnet1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
We recommend using Azure Native.
published on Monday, Mar 9, 2026 by Pulumi
