1. Packages
  2. Azure Classic
  3. API Docs
  4. network
  5. VirtualNetwork

We recommend using Azure Native.

Azure Classic v5.49.0 published on Tuesday, Aug 29, 2023 by Pulumi

azure.network.VirtualNetwork

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.49.0 published on Tuesday, Aug 29, 2023 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 System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Azure = Pulumi.Azure;
    
    return await Deployment.RunAsync(() => 
    {
        var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
        {
            Location = "West Europe",
        });
    
        var exampleNetworkSecurityGroup = new Azure.Network.NetworkSecurityGroup("exampleNetworkSecurityGroup", new()
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
        });
    
        var exampleVirtualNetwork = new Azure.Network.VirtualNetwork("exampleVirtualNetwork", new()
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            AddressSpaces = new[]
            {
                "10.0.0.0/16",
            },
            DnsServers = new[]
            {
                "10.0.0.4",
                "10.0.0.5",
            },
            Subnets = new[]
            {
                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/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/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
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.core.ResourceGroup;
    import com.pulumi.azure.core.ResourceGroupArgs;
    import com.pulumi.azure.network.NetworkSecurityGroup;
    import com.pulumi.azure.network.NetworkSecurityGroupArgs;
    import com.pulumi.azure.network.VirtualNetwork;
    import com.pulumi.azure.network.VirtualNetworkArgs;
    import com.pulumi.azure.network.inputs.VirtualNetworkSubnetArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
                .location("West Europe")
                .build());
    
            var exampleNetworkSecurityGroup = new NetworkSecurityGroup("exampleNetworkSecurityGroup", NetworkSecurityGroupArgs.builder()        
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .addressSpaces("10.0.0.0/16")
                .dnsServers(            
                    "10.0.0.4",
                    "10.0.0.5")
                .subnets(            
                    VirtualNetworkSubnetArgs.builder()
                        .name("subnet1")
                        .addressPrefix("10.0.1.0/24")
                        .build(),
                    VirtualNetworkSubnetArgs.builder()
                        .name("subnet2")
                        .addressPrefix("10.0.2.0/24")
                        .securityGroup(exampleNetworkSecurityGroup.id())
                        .build())
                .tags(Map.of("environment", "Production"))
                .build());
    
        }
    }
    
    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",
        })
    
    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",
        },
    });
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        properties:
          location: West Europe
      exampleNetworkSecurityGroup:
        type: azure:network:NetworkSecurityGroup
        properties:
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
      exampleVirtualNetwork:
        type: azure:network:VirtualNetwork
        properties:
          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
    

    Create VirtualNetwork Resource

    new VirtualNetwork(name: string, args: VirtualNetworkArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualNetwork(resource_name: 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,
                       edge_zone: Optional[str] = None,
                       encryption: Optional[VirtualNetworkEncryptionArgs] = None,
                       flow_timeout_in_minutes: Optional[int] = 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)
    @overload
    def VirtualNetwork(resource_name: str,
                       args: VirtualNetworkArgs,
                       opts: Optional[ResourceOptions] = 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.
    
    
    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.

    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

    The VirtualNetwork resource accepts the following input properties:

    AddressSpaces List<string>

    The address space that is used the virtual network. You can supply more than one address space.

    ResourceGroupName string

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    BgpCommunity string

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    DdosProtectionPlan VirtualNetworkDdosProtectionPlan

    A ddos_protection_plan block as documented below.

    DnsServers List<string>

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    EdgeZone string

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    Encryption VirtualNetworkEncryption

    A encryption block as defined below.

    FlowTimeoutInMinutes int

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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<VirtualNetworkSubnet>

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    Tags Dictionary<string, string>

    A mapping of tags to assign to the resource.

    AddressSpaces []string

    The address space that is used the virtual network. You can supply more than one address space.

    ResourceGroupName string

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    BgpCommunity string

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    DdosProtectionPlan VirtualNetworkDdosProtectionPlanArgs

    A ddos_protection_plan block as documented below.

    DnsServers []string

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    EdgeZone string

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    Encryption VirtualNetworkEncryptionArgs

    A encryption block as defined below.

    FlowTimeoutInMinutes int

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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 []VirtualNetworkSubnetArgs

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    Tags map[string]string

    A mapping of tags to assign to the resource.

    addressSpaces List<String>

    The address space that is used the virtual network. You can supply more than one address space.

    resourceGroupName String

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    bgpCommunity String

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddosProtectionPlan VirtualNetworkDdosProtectionPlan

    A ddos_protection_plan block as documented below.

    dnsServers List<String>

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edgeZone String

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption VirtualNetworkEncryption

    A encryption block as defined below.

    flowTimeoutInMinutes Integer

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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<VirtualNetworkSubnet>

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags Map<String,String>

    A mapping of tags to assign to the resource.

    addressSpaces string[]

    The address space that is used the virtual network. You can supply more than one address space.

    resourceGroupName string

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    bgpCommunity string

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddosProtectionPlan VirtualNetworkDdosProtectionPlan

    A ddos_protection_plan block as documented below.

    dnsServers string[]

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edgeZone string

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption VirtualNetworkEncryption

    A encryption block as defined below.

    flowTimeoutInMinutes number

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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 VirtualNetworkSubnet[]

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags {[key: string]: string}

    A mapping of tags to assign to the resource.

    address_spaces Sequence[str]

    The address space that is used the virtual network. You can supply more than one address space.

    resource_group_name str

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    bgp_community str

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddos_protection_plan VirtualNetworkDdosProtectionPlanArgs

    A ddos_protection_plan block as documented below.

    dns_servers Sequence[str]

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edge_zone str

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption VirtualNetworkEncryptionArgs

    A encryption block as defined below.

    flow_timeout_in_minutes int

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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[VirtualNetworkSubnetArgs]

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags Mapping[str, str]

    A mapping of tags to assign to the resource.

    addressSpaces List<String>

    The address space that is used the virtual network. You can supply more than one address space.

    resourceGroupName String

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    bgpCommunity String

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddosProtectionPlan Property Map

    A ddos_protection_plan block as documented below.

    dnsServers List<String>

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edgeZone String

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption Property Map

    A encryption block as defined below.

    flowTimeoutInMinutes Number

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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 subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags Map<String>

    A mapping of tags to assign to the resource.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the VirtualNetwork resource produces the following output properties:

    Guid string

    The GUID of the virtual network.

    Id string

    The provider-assigned unique ID for this managed resource.

    Guid string

    The GUID of the virtual network.

    Id string

    The provider-assigned unique ID for this managed resource.

    guid String

    The GUID of the virtual network.

    id String

    The provider-assigned unique ID for this managed resource.

    guid string

    The GUID of the virtual network.

    id string

    The provider-assigned unique ID for this managed resource.

    guid str

    The GUID of the virtual network.

    id str

    The provider-assigned unique ID for this managed resource.

    guid String

    The GUID of the virtual network.

    id String

    The provider-assigned unique ID for this managed resource.

    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,
            edge_zone: Optional[str] = None,
            encryption: Optional[VirtualNetworkEncryptionArgs] = 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) -> VirtualNetwork
    func 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    AddressSpaces List<string>

    The address space that is used the virtual network. You can supply more than one address space.

    BgpCommunity string

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    DdosProtectionPlan VirtualNetworkDdosProtectionPlan

    A ddos_protection_plan block as documented below.

    DnsServers List<string>

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    EdgeZone string

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    Encryption VirtualNetworkEncryption

    A encryption block as defined below.

    FlowTimeoutInMinutes int

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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.

    ResourceGroupName string

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    Subnets List<VirtualNetworkSubnet>

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    Tags Dictionary<string, string>

    A mapping of tags to assign to the resource.

    AddressSpaces []string

    The address space that is used the virtual network. You can supply more than one address space.

    BgpCommunity string

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    DdosProtectionPlan VirtualNetworkDdosProtectionPlanArgs

    A ddos_protection_plan block as documented below.

    DnsServers []string

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    EdgeZone string

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    Encryption VirtualNetworkEncryptionArgs

    A encryption block as defined below.

    FlowTimeoutInMinutes int

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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.

    ResourceGroupName string

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    Subnets []VirtualNetworkSubnetArgs

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    Tags map[string]string

    A mapping of tags to assign to the resource.

    addressSpaces List<String>

    The address space that is used the virtual network. You can supply more than one address space.

    bgpCommunity String

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddosProtectionPlan VirtualNetworkDdosProtectionPlan

    A ddos_protection_plan block as documented below.

    dnsServers List<String>

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edgeZone String

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption VirtualNetworkEncryption

    A encryption block as defined below.

    flowTimeoutInMinutes Integer

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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.

    resourceGroupName String

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    subnets List<VirtualNetworkSubnet>

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags Map<String,String>

    A mapping of tags to assign to the resource.

    addressSpaces string[]

    The address space that is used the virtual network. You can supply more than one address space.

    bgpCommunity string

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddosProtectionPlan VirtualNetworkDdosProtectionPlan

    A ddos_protection_plan block as documented below.

    dnsServers string[]

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edgeZone string

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption VirtualNetworkEncryption

    A encryption block as defined below.

    flowTimeoutInMinutes number

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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.

    resourceGroupName string

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    subnets VirtualNetworkSubnet[]

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags {[key: string]: string}

    A mapping of tags to assign to the resource.

    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>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddos_protection_plan VirtualNetworkDdosProtectionPlanArgs

    A ddos_protection_plan block as documented below.

    dns_servers Sequence[str]

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edge_zone str

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption VirtualNetworkEncryptionArgs

    A encryption block as defined below.

    flow_timeout_in_minutes int

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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_name str

    The name of the resource group in which to create the virtual network. Changing this forces a new resource to be created.

    subnets Sequence[VirtualNetworkSubnetArgs]

    Can be specified multiple times to define multiple subnets. Each subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags Mapping[str, str]

    A mapping of tags to assign to the resource.

    addressSpaces List<String>

    The address space that is used the virtual network. You can supply more than one address space.

    bgpCommunity String

    The BGP community attribute in format <as-number>:<community-value>.

    NOTE The as-number segment is the Microsoft ASN, which is always 12076 for now.

    ddosProtectionPlan Property Map

    A ddos_protection_plan block as documented below.

    dnsServers List<String>

    List of IP addresses of DNS servers

    NOTE Since dns_servers can be configured both inline and via the separate azure.network.VirtualNetworkDnsServers resource, we have to explicitly set it to empty slice ([]) to remove it.

    edgeZone String

    Specifies the Edge Zone within the Azure Region where this Virtual Network should exist. Changing this forces a new Virtual Network to be created.

    encryption Property Map

    A encryption block as defined below.

    flowTimeoutInMinutes Number

    The flow timeout in minutes for the Virtual Network, which is used to enable connection tracking for intra-VM flows. Possible values are between 4 and 30 minutes.

    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.

    resourceGroupName String

    The name of the resource group in which to create 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 subnet block supports fields documented below.

    NOTE Since subnet can be configured both inline and via the separate azure.network.Subnet resource, we have to explicitly set it to empty slice ([]) to remove it.

    tags Map<String>

    A mapping of tags to assign to the resource.

    Supporting Types

    VirtualNetworkDdosProtectionPlan, VirtualNetworkDdosProtectionPlanArgs

    Enable bool

    Enable/disable DDoS Protection Plan on Virtual Network.

    Id string

    The ID of DDoS Protection Plan.

    Enable bool

    Enable/disable DDoS Protection Plan on Virtual Network.

    Id string

    The ID of DDoS Protection Plan.

    enable Boolean

    Enable/disable DDoS Protection Plan on Virtual Network.

    id String

    The ID of DDoS Protection Plan.

    enable boolean

    Enable/disable DDoS Protection Plan on Virtual Network.

    id string

    The ID of DDoS Protection Plan.

    enable bool

    Enable/disable DDoS Protection Plan on Virtual Network.

    id str

    The ID of DDoS Protection Plan.

    enable Boolean

    Enable/disable DDoS Protection Plan on Virtual Network.

    id String

    The ID of DDoS Protection Plan.

    VirtualNetworkEncryption, VirtualNetworkEncryptionArgs

    Enforcement string

    Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted.

    Enforcement string

    Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted.

    enforcement String

    Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted.

    enforcement string

    Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted.

    enforcement str

    Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted.

    enforcement String

    Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted.

    VirtualNetworkSubnet, VirtualNetworkSubnetArgs

    AddressPrefix string

    The address prefix to use for the subnet.

    Name string

    The name of the subnet.

    Id string

    The ID of DDoS Protection Plan.

    SecurityGroup string

    The Network Security Group to associate with the subnet. (Referenced by id, ie. azurerm_network_security_group.example.id)

    AddressPrefix string

    The address prefix to use for the subnet.

    Name string

    The name of the subnet.

    Id string

    The ID of DDoS Protection Plan.

    SecurityGroup string

    The Network Security Group to associate with the subnet. (Referenced by id, ie. azurerm_network_security_group.example.id)

    addressPrefix String

    The address prefix to use for the subnet.

    name String

    The name of the subnet.

    id String

    The ID of DDoS Protection Plan.

    securityGroup String

    The Network Security Group to associate with the subnet. (Referenced by id, ie. azurerm_network_security_group.example.id)

    addressPrefix string

    The address prefix to use for the subnet.

    name string

    The name of the subnet.

    id string

    The ID of DDoS Protection Plan.

    securityGroup 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 subnet.

    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)

    addressPrefix String

    The address prefix to use for the subnet.

    name String

    The name of the subnet.

    id String

    The ID of DDoS Protection Plan.

    securityGroup 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
    

    Package Details

    Repository
    Azure Classic pulumi/pulumi-azure
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the azurerm Terraform Provider.

    azure logo

    We recommend using Azure Native.

    Azure Classic v5.49.0 published on Tuesday, Aug 29, 2023 by Pulumi