Virtual Network Args
data class VirtualNetworkArgs(val dhcpOptions: Output<VirtualNetworkPropertiesDhcpOptionsArgs>? = null, val extendedLocation: Output<ExtendedLocationArgs>? = null, val location: Output<String>? = null, val networkType: Output<Either<String, NetworkTypeEnum>>? = null, val resourceGroupName: Output<String>? = null, val subnets: Output<List<VirtualNetworkPropertiesSubnetsArgs>>? = null, val tags: Output<Map<String, String>>? = null, val virtualNetworkName: Output<String>? = null, val vmSwitchName: Output<String>? = null) : ConvertibleToJava<VirtualNetworkArgs>
The virtual network resource definition. Uses Azure REST API version 2022-12-15-preview. Other available API versions: 2023-07-01-preview.
Example Usage
PutVirtualNetwork
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualNetwork = new AzureNative.AzureStackHCI.VirtualNetwork("virtualNetwork", new()
{
ExtendedLocation = new AzureNative.AzureStackHCI.Inputs.ExtendedLocationArgs
{
Name = "/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location",
Type = AzureNative.AzureStackHCI.ExtendedLocationTypes.CustomLocation,
},
Location = "West US2",
NetworkType = AzureNative.AzureStackHCI.NetworkTypeEnum.Transparent,
ResourceGroupName = "test-rg",
VirtualNetworkName = "test-vnet",
});
});
Content copied to clipboard
package main
import (
azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := azurestackhci.NewVirtualNetwork(ctx, "virtualNetwork", &azurestackhci.VirtualNetworkArgs{
ExtendedLocation: &azurestackhci.ExtendedLocationArgs{
Name: pulumi.String("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location"),
Type: pulumi.String(azurestackhci.ExtendedLocationTypesCustomLocation),
},
Location: pulumi.String("West US2"),
NetworkType: pulumi.String(azurestackhci.NetworkTypeEnumTransparent),
ResourceGroupName: pulumi.String("test-rg"),
VirtualNetworkName: pulumi.String("test-vnet"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.azurestackhci.VirtualNetwork;
import com.pulumi.azurenative.azurestackhci.VirtualNetworkArgs;
import com.pulumi.azurenative.azurestackhci.inputs.ExtendedLocationArgs;
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 virtualNetwork = new VirtualNetwork("virtualNetwork", VirtualNetworkArgs.builder()
.extendedLocation(ExtendedLocationArgs.builder()
.name("/subscriptions/a95612cb-f1fa-4daa-a4fd-272844fa512c/resourceGroups/dogfoodarc/providers/Microsoft.ExtendedLocation/customLocations/dogfood-location")
.type("CustomLocation")
.build())
.location("West US2")
.networkType("Transparent")
.resourceGroupName("test-rg")
.virtualNetworkName("test-vnet")
.build());
}
}
Content copied to clipboard
Import
An existing resource can be imported using its type token, name, and identifier, e.g.
$ pulumi import azure-native:azurestackhci:VirtualNetwork test-vnet /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureStackHCI/virtualNetworks/{virtualNetworkName}
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(dhcpOptions: Output<VirtualNetworkPropertiesDhcpOptionsArgs>? = null, extendedLocation: Output<ExtendedLocationArgs>? = null, location: Output<String>? = null, networkType: Output<Either<String, NetworkTypeEnum>>? = null, resourceGroupName: Output<String>? = null, subnets: Output<List<VirtualNetworkPropertiesSubnetsArgs>>? = null, tags: Output<Map<String, String>>? = null, virtualNetworkName: Output<String>? = null, vmSwitchName: Output<String>? = null)
Properties
Link copied to clipboard
DhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. Standard DHCP option for a subnet overrides VNET DHCP options.
Link copied to clipboard
The extendedLocation of the resource.
Link copied to clipboard
Type of the network
Link copied to clipboard
The name of the resource group. The name is case insensitive.
Link copied to clipboard
Subnet - list of subnets under the virtual network
Link copied to clipboard
Name of the virtual network
Link copied to clipboard
name of the network switch to be used for VMs