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
new VirtualNetwork(name: string, args: VirtualNetworkArgs, opts?: CustomResourceOptions);def VirtualNetwork(resource_name, opts=None, description=None, lab_name=None, name=None, resource_group_name=None, subnet=None, tags=None, __props__=None);func NewVirtualNetwork(ctx *Context, name string, args VirtualNetworkArgs, opts ...ResourceOption) (*VirtualNetwork, error)public VirtualNetwork(string name, VirtualNetworkArgs args, CustomResourceOptions? opts = null)- 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:
- 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
subnetblock 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 A
subnetblock 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 A
subnetblock 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
Dict[Virtual
Network Subnet] A
subnetblock as defined below.- 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.
- 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.
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): VirtualNetworkstatic 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.
- 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
subnetblock 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 A
subnetblock 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 A
subnetblock 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
Dict[Virtual
Network Subnet] A
subnetblock as defined below.- 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
- 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,DefaultandDeny.- Use
Public stringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow,DefaultandDeny.
- 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,DefaultandDeny.- Use
Public stringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow,DefaultandDeny.
- 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,DefaultandDeny.- use
Public stringIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow,DefaultandDeny.
- 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,DefaultandDeny.- use
Public strIp Address Can Virtual Machines in this Subnet use Public IP Addresses? Possible values are
Allow,DefaultandDeny.
Package Details
- Repository
- https://github.com/pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.