Virtual Network Args
The virtual network resource definition. Uses Azure REST API version 2023-07-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-12-15-preview. Other available API versions: 2022-12-15-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native azurestackhci [ApiVersion]
. See the ../../../version-guide/#accessing-any-api-version-via-local-packages for details.
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",
});
});
package main
import (
azurestackhci "github.com/pulumi/pulumi-azure-native-sdk/azurestackhci/v3"
"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
})
}
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());
}
}
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}
Constructors
Properties
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.
The extendedLocation of the resource.
Type of the network
The name of the resource group. The name is case insensitive.
Subnet - list of subnets under the virtual network
Name of the virtual network
name of the network switch to be used for VMs