VirtualNetwork

Manages a Virtual Network within a DevTest Lab.

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 US",
        });
        var exampleLab = new Azure.DevTest.Lab("exampleLab", new Azure.DevTest.LabArgs
        {
            Location = exampleResourceGroup.Location,
            ResourceGroupName = exampleResourceGroup.Name,
            Tags = 
            {
                { "Sydney", "Australia" },
            },
        });
        var exampleVirtualNetwork = new Azure.DevTest.VirtualNetwork("exampleVirtualNetwork", new Azure.DevTest.VirtualNetworkArgs
        {
            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/v3/go/azure/core"
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/devtest"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
            Location: pulumi.String("West US"),
        })
        if err != nil {
            return err
        }
        exampleLab, err := devtest.NewLab(ctx, "exampleLab", &devtest.LabArgs{
            Location:          exampleResourceGroup.Location,
            ResourceGroupName: exampleResourceGroup.Name,
            Tags: pulumi.Map{
                "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
    })
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West US")
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={
        "usePublicIpAddress": "Allow",
        "useInVirtualMachineCreation": "Allow",
    })
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West US"});
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",
    },
});

Create a VirtualNetwork Resource

def VirtualNetwork(resource_name, opts=None, description=None, lab_name=None, name=None, resource_group_name=None, subnet=None, tags=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

VirtualNetwork Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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 VirtualNetworkSubnet

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 VirtualNetworkSubnet

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

A subnet block as defined below.

tags Dict[str, str]

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 str
The provider-assigned unique ID for this managed resource.
unique_identifier str

The unique immutable identifier of the Dev Test Virtual Network.

Look up an 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
static get(resource_name, id, opts=None, description=None, lab_name=None, name=None, resource_group_name=None, subnet=None, tags=None, unique_identifier=None, __props__=None);
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)
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.

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 VirtualNetworkSubnet

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 VirtualNetworkSubnet

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

A subnet block as defined below.

tags Dict[str, str]

A mapping of tags to assign to the resource.

unique_identifier str

The unique immutable identifier of the Dev Test Virtual Network.

Supporting Types

VirtualNetworkSubnet

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

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.

useInVirtualMachineCreation str

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

usePublicIpAddress str

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

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.