Virtual Machine Args
data class VirtualMachineArgs(val allowClaim: Output<Boolean>? = null, val artifacts: Output<List<ArtifactInstallPropertiesArgs>>? = null, val createdDate: Output<String>? = null, val customImageId: Output<String>? = null, val dataDiskParameters: Output<List<DataDiskPropertiesArgs>>? = null, val disallowPublicIpAddress: Output<Boolean>? = null, val environmentId: Output<String>? = null, val expirationDate: Output<String>? = null, val galleryImageReference: Output<GalleryImageReferenceArgs>? = null, val isAuthenticationWithSshKey: Output<Boolean>? = null, val labName: Output<String>? = null, val labSubnetName: Output<String>? = null, val labVirtualNetworkId: Output<String>? = null, val location: Output<String>? = null, val name: Output<String>? = null, val networkInterface: Output<NetworkInterfacePropertiesArgs>? = null, val notes: Output<String>? = null, val ownerObjectId: Output<String>? = null, val ownerUserPrincipalName: Output<String>? = null, val password: Output<String>? = null, val planId: Output<String>? = null, val resourceGroupName: Output<String>? = null, val scheduleParameters: Output<List<ScheduleCreationParameterArgs>>? = null, val size: Output<String>? = null, val sshKey: Output<String>? = null, val storageType: Output<String>? = null, val tags: Output<Map<String, String>>? = null, val userName: Output<String>? = null) : ConvertibleToJava<VirtualMachineArgs>
A virtual machine. Azure REST API version: 2018-09-15. Prior API version in Azure Native 1.x: 2018-09-15. Other available API versions: 2016-05-15.
Example Usage
VirtualMachines_CreateOrUpdate
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var virtualMachine = new AzureNative.DevTestLab.VirtualMachine("virtualMachine", new()
{
AllowClaim = true,
DisallowPublicIpAddress = true,
GalleryImageReference = new AzureNative.DevTestLab.Inputs.GalleryImageReferenceArgs
{
Offer = "UbuntuServer",
OsType = "Linux",
Publisher = "Canonical",
Sku = "16.04-LTS",
Version = "Latest",
},
LabName = "{labName}",
LabSubnetName = "{virtualNetworkName}Subnet",
LabVirtualNetworkId = "/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}",
Location = "{location}",
Name = "{vmName}",
Password = "{userPassword}",
ResourceGroupName = "resourceGroupName",
Size = "Standard_A2_v2",
StorageType = "Standard",
Tags =
{
{ "tagName1", "tagValue1" },
},
UserName = "{userName}",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure-native-sdk/devtestlab/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := devtestlab.NewVirtualMachine(ctx, "virtualMachine", &devtestlab.VirtualMachineArgs{
AllowClaim: pulumi.Bool(true),
DisallowPublicIpAddress: pulumi.Bool(true),
GalleryImageReference: &devtestlab.GalleryImageReferenceArgs{
Offer: pulumi.String("UbuntuServer"),
OsType: pulumi.String("Linux"),
Publisher: pulumi.String("Canonical"),
Sku: pulumi.String("16.04-LTS"),
Version: pulumi.String("Latest"),
},
LabName: pulumi.String("{labName}"),
LabSubnetName: pulumi.String("{virtualNetworkName}Subnet"),
LabVirtualNetworkId: pulumi.String("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}"),
Location: pulumi.String("{location}"),
Name: pulumi.String("{vmName}"),
Password: pulumi.String("{userPassword}"),
ResourceGroupName: pulumi.String("resourceGroupName"),
Size: pulumi.String("Standard_A2_v2"),
StorageType: pulumi.String("Standard"),
Tags: pulumi.StringMap{
"tagName1": pulumi.String("tagValue1"),
},
UserName: pulumi.String("{userName}"),
})
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.devtestlab.VirtualMachine;
import com.pulumi.azurenative.devtestlab.VirtualMachineArgs;
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 virtualMachine = new VirtualMachine("virtualMachine", VirtualMachineArgs.builder()
.allowClaim(true)
.disallowPublicIpAddress(true)
.galleryImageReference(Map.ofEntries(
Map.entry("offer", "UbuntuServer"),
Map.entry("osType", "Linux"),
Map.entry("publisher", "Canonical"),
Map.entry("sku", "16.04-LTS"),
Map.entry("version", "Latest")
))
.labName("{labName}")
.labSubnetName("{virtualNetworkName}Subnet")
.labVirtualNetworkId("/subscriptions/{subscriptionId}/resourcegroups/resourceGroupName/providers/microsoft.devtestlab/labs/{labName}/virtualnetworks/{virtualNetworkName}")
.location("{location}")
.name("{vmName}")
.password("{userPassword}")
.resourceGroupName("resourceGroupName")
.size("Standard_A2_v2")
.storageType("Standard")
.tags(Map.of("tagName1", "tagValue1"))
.userName("{userName}")
.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:devtestlab:VirtualMachine {vmName} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/virtualmachines/{name}
Content copied to clipboard
Constructors
Link copied to clipboard
fun VirtualMachineArgs(allowClaim: Output<Boolean>? = null, artifacts: Output<List<ArtifactInstallPropertiesArgs>>? = null, createdDate: Output<String>? = null, customImageId: Output<String>? = null, dataDiskParameters: Output<List<DataDiskPropertiesArgs>>? = null, disallowPublicIpAddress: Output<Boolean>? = null, environmentId: Output<String>? = null, expirationDate: Output<String>? = null, galleryImageReference: Output<GalleryImageReferenceArgs>? = null, isAuthenticationWithSshKey: Output<Boolean>? = null, labName: Output<String>? = null, labSubnetName: Output<String>? = null, labVirtualNetworkId: Output<String>? = null, location: Output<String>? = null, name: Output<String>? = null, networkInterface: Output<NetworkInterfacePropertiesArgs>? = null, notes: Output<String>? = null, ownerObjectId: Output<String>? = null, ownerUserPrincipalName: Output<String>? = null, password: Output<String>? = null, planId: Output<String>? = null, resourceGroupName: Output<String>? = null, scheduleParameters: Output<List<ScheduleCreationParameterArgs>>? = null, size: Output<String>? = null, sshKey: Output<String>? = null, storageType: Output<String>? = null, tags: Output<Map<String, String>>? = null, userName: Output<String>? = null)
Functions
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard