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

We recommend using Azure Native.

Azure Classic v5.43.0 published on Saturday, May 6, 2023 by Pulumi

azure.devtest.VirtualNetwork

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.43.0 published on Saturday, May 6, 2023 by Pulumi

    Manages a Virtual Network within a DevTest Lab.

    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 exampleLab = new Azure.DevTest.Lab("exampleLab", new()
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            Tags = 
            {
                { "Sydney", "Australia" },
            },
        });
    
        var exampleVirtualNetwork = new Azure.DevTest.VirtualNetwork("exampleVirtualNetwork", new()
        {
            LabName = exampleLab.Name,
            ResourceGroupName = exampleResourceGroup.Name,
            Subnet = new Azure.DevTest.Inputs.VirtualNetworkSubnetArgs
            {
                UsePublicIpAddress = "Allow",
                UseInVirtualMachineCreation = "Allow",
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/devtest"
    	"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
    		}
    		exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{
    			Location:          exampleResourceGroup.Location,
    			ResourceGroupName: exampleResourceGroup.Name,
    			Tags: pulumi.StringMap{
    				"Sydney": pulumi.String("Australia"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = devtest.NewVirtualNetwork(ctx, "exampleVirtualNetwork", &devtest.VirtualNetworkArgs{
    			LabName:           exampleLab.Name,
    			ResourceGroupName: exampleResourceGroup.Name,
    			Subnet: &devtest.VirtualNetworkSubnetArgs{
    				UsePublicIpAddress:          pulumi.String("Allow"),
    				UseInVirtualMachineCreation: pulumi.String("Allow"),
    			},
    		})
    		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.devtest.Lab;
    import com.pulumi.azure.devtest.LabArgs;
    import com.pulumi.azure.devtest.VirtualNetwork;
    import com.pulumi.azure.devtest.VirtualNetworkArgs;
    import com.pulumi.azure.devtest.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 exampleLab = new Lab("exampleLab", LabArgs.builder()        
                .location(exampleResourceGroup.location())
                .resourceGroupName(exampleResourceGroup.name())
                .tags(Map.of("Sydney", "Australia"))
                .build());
    
            var exampleVirtualNetwork = new VirtualNetwork("exampleVirtualNetwork", VirtualNetworkArgs.builder()        
                .labName(exampleLab.name())
                .resourceGroupName(exampleResourceGroup.name())
                .subnet(VirtualNetworkSubnetArgs.builder()
                    .usePublicIpAddress("Allow")
                    .useInVirtualMachineCreation("Allow")
                    .build())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure as azure
    
    example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
    example_lab = azure.devtest.Lab("exampleLab",
        location=example_resource_group.location,
        resource_group_name=example_resource_group.name,
        tags={
            "Sydney": "Australia",
        })
    example_virtual_network = azure.devtest.VirtualNetwork("exampleVirtualNetwork",
        lab_name=example_lab.name,
        resource_group_name=example_resource_group.name,
        subnet=azure.devtest.VirtualNetworkSubnetArgs(
            use_public_ip_address="Allow",
            use_in_virtual_machine_creation="Allow",
        ))
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
    const exampleLab = new azure.devtest.Lab("exampleLab", {
        location: exampleResourceGroup.location,
        resourceGroupName: exampleResourceGroup.name,
        tags: {
            Sydney: "Australia",
        },
    });
    const exampleVirtualNetwork = new azure.devtest.VirtualNetwork("exampleVirtualNetwork", {
        labName: exampleLab.name,
        resourceGroupName: exampleResourceGroup.name,
        subnet: {
            usePublicIpAddress: "Allow",
            useInVirtualMachineCreation: "Allow",
        },
    });
    
    resources:
      exampleResourceGroup:
        type: azure:core:ResourceGroup
        properties:
          location: West Europe
      exampleLab:
        type: azure:devtest:Lab
        properties:
          location: ${exampleResourceGroup.location}
          resourceGroupName: ${exampleResourceGroup.name}
          tags:
            Sydney: Australia
      exampleVirtualNetwork:
        type: azure:devtest:VirtualNetwork
        properties:
          labName: ${exampleLab.name}
          resourceGroupName: ${exampleResourceGroup.name}
          subnet:
            usePublicIpAddress: Allow
            useInVirtualMachineCreation: Allow
    

    Create VirtualNetwork Resource

    new VirtualNetwork(name: string, args: VirtualNetworkArgs, opts?: CustomResourceOptions);
    @overload
    def VirtualNetwork(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       description: Optional[str] = None,
                       lab_name: Optional[str] = None,
                       name: Optional[str] = None,
                       resource_group_name: Optional[str] = None,
                       subnet: Optional[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:devtest: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:

    LabName string

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    ResourceGroupName string

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    Description string

    A description for the Virtual Network.

    Name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    Subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    Tags Dictionary<string, string>

    A mapping of tags to assign to the resource.

    LabName string

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    ResourceGroupName string

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    Description string

    A description for the Virtual Network.

    Name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    Subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    Tags map[string]string

    A mapping of tags to assign to the resource.

    labName String

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    resourceGroupName String

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    description String

    A description for the Virtual Network.

    name String

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    tags Map<String,String>

    A mapping of tags to assign to the resource.

    labName string

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    resourceGroupName string

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    description string

    A description for the Virtual Network.

    name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    tags {[key: string]: string}

    A mapping of tags to assign to the resource.

    lab_name str

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    resource_group_name str

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    description str

    A description for the Virtual Network.

    name str

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    tags Mapping[str, str]

    A mapping of tags to assign to the resource.

    labName String

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    resourceGroupName String

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    description String

    A description for the Virtual Network.

    name String

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    subnet Property Map

    A subnet block as defined below.

    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:

    Id string

    The provider-assigned unique ID for this managed resource.

    UniqueIdentifier string

    The unique immutable identifier of the Dev Test Virtual Network.

    Id string

    The provider-assigned unique ID for this managed resource.

    UniqueIdentifier string

    The unique immutable identifier of the Dev Test Virtual Network.

    id String

    The provider-assigned unique ID for this managed resource.

    uniqueIdentifier String

    The unique immutable identifier of the Dev Test Virtual Network.

    id string

    The provider-assigned unique ID for this managed resource.

    uniqueIdentifier string

    The unique immutable identifier of the Dev Test Virtual Network.

    id str

    The provider-assigned unique ID for this managed resource.

    unique_identifier str

    The unique immutable identifier of the Dev Test Virtual Network.

    id String

    The provider-assigned unique ID for this managed resource.

    uniqueIdentifier String

    The unique immutable identifier of the Dev Test Virtual Network.

    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,
            description: Optional[str] = None,
            lab_name: Optional[str] = None,
            name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            subnet: Optional[VirtualNetworkSubnetArgs] = None,
            tags: Optional[Mapping[str, str]] = None,
            unique_identifier: Optional[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:
    Description string

    A description for the Virtual Network.

    LabName string

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    Name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    ResourceGroupName string

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    Subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    Tags Dictionary<string, string>

    A mapping of tags to assign to the resource.

    UniqueIdentifier string

    The unique immutable identifier of the Dev Test Virtual Network.

    Description string

    A description for the Virtual Network.

    LabName string

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    Name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    ResourceGroupName string

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    Subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    Tags map[string]string

    A mapping of tags to assign to the resource.

    UniqueIdentifier string

    The unique immutable identifier of the Dev Test Virtual Network.

    description String

    A description for the Virtual Network.

    labName String

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    name String

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    resourceGroupName String

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    tags Map<String,String>

    A mapping of tags to assign to the resource.

    uniqueIdentifier String

    The unique immutable identifier of the Dev Test Virtual Network.

    description string

    A description for the Virtual Network.

    labName string

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    resourceGroupName string

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    tags {[key: string]: string}

    A mapping of tags to assign to the resource.

    uniqueIdentifier string

    The unique immutable identifier of the Dev Test Virtual Network.

    description str

    A description for the Virtual Network.

    lab_name str

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    name str

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    resource_group_name str

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    subnet VirtualNetworkSubnetArgs

    A subnet block as defined below.

    tags Mapping[str, str]

    A mapping of tags to assign to the resource.

    unique_identifier str

    The unique immutable identifier of the Dev Test Virtual Network.

    description String

    A description for the Virtual Network.

    labName String

    Specifies the name of the Dev Test Lab in which the Virtual Network should be created. Changing this forces a new resource to be created.

    name String

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    resourceGroupName String

    The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.

    subnet Property Map

    A subnet block as defined below.

    tags Map<String>

    A mapping of tags to assign to the resource.

    uniqueIdentifier String

    The unique immutable identifier of the Dev Test Virtual Network.

    Supporting Types

    VirtualNetworkSubnet

    Name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    UseInVirtualMachineCreation string

    Can this subnet be used for creating Virtual Machines? Possible values are Allow, Default and Deny.

    UsePublicIpAddress string

    Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are Allow, Default and Deny.

    Name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    UseInVirtualMachineCreation string

    Can this subnet be used for creating Virtual Machines? Possible values are Allow, Default and Deny.

    UsePublicIpAddress string

    Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are Allow, Default and Deny.

    name String

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    useInVirtualMachineCreation String

    Can this subnet be used for creating Virtual Machines? Possible values are Allow, Default and Deny.

    usePublicIpAddress String

    Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are Allow, Default and Deny.

    name string

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    useInVirtualMachineCreation string

    Can this subnet be used for creating Virtual Machines? Possible values are Allow, Default and Deny.

    usePublicIpAddress string

    Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are Allow, Default and Deny.

    name str

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    use_in_virtual_machine_creation str

    Can this subnet be used for creating Virtual Machines? Possible values are Allow, Default and Deny.

    use_public_ip_address str

    Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are Allow, Default and Deny.

    name String

    Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.

    useInVirtualMachineCreation String

    Can this subnet be used for creating Virtual Machines? Possible values are Allow, Default and Deny.

    usePublicIpAddress String

    Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are Allow, Default and Deny.

    Import

    DevTest Virtual Networks can be imported using the resource id, e.g.

     $ pulumi import azure:devtest/virtualNetwork:VirtualNetwork network1 /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.DevTestLab/labs/lab1/virtualNetworks/network1
    

    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.43.0 published on Saturday, May 6, 2023 by Pulumi