We recommend using Azure Native.
azure.devtest.VirtualNetwork
Explore with Pulumi AI
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:
- Lab
Name 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.
- Resource
Group stringName 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
Virtual
Network Subnet Args A
subnet
block as defined below.- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Lab
Name 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.
- Resource
Group stringName 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
Virtual
Network Subnet Args A
subnet
block as defined below.- map[string]string
A mapping of tags to assign to the resource.
- lab
Name 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.
- resource
Group StringName 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
Virtual
Network Subnet Args A
subnet
block as defined below.- Map<String,String>
A mapping of tags to assign to the resource.
- lab
Name 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.
- resource
Group stringName 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
Virtual
Network Subnet Args A
subnet
block as defined below.- {[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_ strname 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
Virtual
Network Subnet Args A
subnet
block as defined below.- Mapping[str, str]
A mapping of tags to assign to the resource.
- lab
Name 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.
- resource
Group StringName 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.- 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.
- Unique
Identifier string The unique immutable identifier of the Dev Test Virtual Network.
- Id string
The provider-assigned unique ID for this managed resource.
- Unique
Identifier string The unique immutable identifier of the Dev Test Virtual Network.
- id String
The provider-assigned unique ID for this managed resource.
- unique
Identifier String The unique immutable identifier of the Dev Test Virtual Network.
- id string
The provider-assigned unique ID for this managed resource.
- unique
Identifier 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.
- unique
Identifier 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.
- Description string
A description for the Virtual Network.
- Lab
Name 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.
- Resource
Group stringName The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.
- Subnet
Virtual
Network Subnet Args A
subnet
block as defined below.- Dictionary<string, string>
A mapping of tags to assign to the resource.
- Unique
Identifier string The unique immutable identifier of the Dev Test Virtual Network.
- Description string
A description for the Virtual Network.
- Lab
Name 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.
- Resource
Group stringName The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.
- Subnet
Virtual
Network Subnet Args A
subnet
block as defined below.- map[string]string
A mapping of tags to assign to the resource.
- Unique
Identifier string The unique immutable identifier of the Dev Test Virtual Network.
- description String
A description for the Virtual Network.
- lab
Name 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.
- resource
Group StringName The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.
- subnet
Virtual
Network Subnet Args A
subnet
block as defined below.- Map<String,String>
A mapping of tags to assign to the resource.
- unique
Identifier String The unique immutable identifier of the Dev Test Virtual Network.
- description string
A description for the Virtual Network.
- lab
Name 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.
- resource
Group stringName The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.
- subnet
Virtual
Network Subnet Args A
subnet
block as defined below.- {[key: string]: string}
A mapping of tags to assign to the resource.
- unique
Identifier 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_ strname The name of the resource group in which the Dev Test Lab resource exists. Changing this forces a new resource to be created.
- subnet
Virtual
Network Subnet Args A
subnet
block as defined below.- 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.
- lab
Name 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.
- resource
Group StringName 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.- Map<String>
A mapping of tags to assign to the resource.
- unique
Identifier 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.
- Use
In stringVirtual Machine Creation Can this subnet be used for creating Virtual Machines? Possible values are
Allow
,Default
andDeny
.- Use
Public stringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow
,Default
andDeny
.
- Name string
Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.
- Use
In stringVirtual Machine Creation Can this subnet be used for creating Virtual Machines? Possible values are
Allow
,Default
andDeny
.- Use
Public stringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow
,Default
andDeny
.
- name String
Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.
- use
In StringVirtual Machine Creation Can this subnet be used for creating Virtual Machines? Possible values are
Allow
,Default
andDeny
.- use
Public StringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow
,Default
andDeny
.
- name string
Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.
- use
In stringVirtual Machine Creation Can this subnet be used for creating Virtual Machines? Possible values are
Allow
,Default
andDeny
.- use
Public stringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow
,Default
andDeny
.
- name str
Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.
- use_
in_ strvirtual_ machine_ creation Can this subnet be used for creating Virtual Machines? Possible values are
Allow
,Default
andDeny
.- use_
public_ strip_ address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow
,Default
andDeny
.
- name String
Specifies the name of the Dev Test Virtual Network. Changing this forces a new resource to be created.
- use
In StringVirtual Machine Creation Can this subnet be used for creating Virtual Machines? Possible values are
Allow
,Default
andDeny
.- use
Public StringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow
,Default
andDeny
.
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.