com.pulumi.azurenative.compute.VirtualMachine Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-native Show documentation
Show all versions of azure-native Show documentation
A native Pulumi package for creating and managing Azure resources.
// *** WARNING: this file was generated by pulumi-java-gen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package com.pulumi.azurenative.compute;
import com.pulumi.azurenative.Utilities;
import com.pulumi.azurenative.compute.VirtualMachineArgs;
import com.pulumi.azurenative.compute.outputs.AdditionalCapabilitiesResponse;
import com.pulumi.azurenative.compute.outputs.ApplicationProfileResponse;
import com.pulumi.azurenative.compute.outputs.BillingProfileResponse;
import com.pulumi.azurenative.compute.outputs.CapacityReservationProfileResponse;
import com.pulumi.azurenative.compute.outputs.DiagnosticsProfileResponse;
import com.pulumi.azurenative.compute.outputs.ExtendedLocationResponse;
import com.pulumi.azurenative.compute.outputs.HardwareProfileResponse;
import com.pulumi.azurenative.compute.outputs.NetworkProfileResponse;
import com.pulumi.azurenative.compute.outputs.OSProfileResponse;
import com.pulumi.azurenative.compute.outputs.PlanResponse;
import com.pulumi.azurenative.compute.outputs.ScheduledEventsProfileResponse;
import com.pulumi.azurenative.compute.outputs.SecurityProfileResponse;
import com.pulumi.azurenative.compute.outputs.StorageProfileResponse;
import com.pulumi.azurenative.compute.outputs.SubResourceResponse;
import com.pulumi.azurenative.compute.outputs.VirtualMachineExtensionResponse;
import com.pulumi.azurenative.compute.outputs.VirtualMachineIdentityResponse;
import com.pulumi.azurenative.compute.outputs.VirtualMachineInstanceViewResponse;
import com.pulumi.core.Alias;
import com.pulumi.core.Output;
import com.pulumi.core.annotations.Export;
import com.pulumi.core.annotations.ResourceType;
import com.pulumi.core.internal.Codegen;
import java.lang.Integer;
import java.lang.String;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import javax.annotation.Nullable;
/**
* Describes a Virtual Machine.
* Azure REST API version: 2023-03-01. Prior API version in Azure Native 1.x: 2021-03-01.
*
* Other available API versions: 2023-07-01, 2023-09-01, 2024-03-01, 2024-07-01.
*
* ## Example Usage
* ### Create a Linux vm with a patch setting assessmentMode of ImageDefault.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2s_v3")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .linuxConfiguration(LinuxConfigurationArgs.builder()
* .patchSettings(LinuxPatchSettingsArgs.builder()
* .assessmentMode("ImageDefault")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("UbuntuServer")
* .publisher("Canonical")
* .sku("16.04-LTS")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Linux vm with a patch setting patchMode of AutomaticByPlatform and AutomaticByPlatformSettings.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxVMGuestPatchAutomaticByPlatformSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2s_v3")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .linuxConfiguration(LinuxConfigurationArgs.builder()
* .patchSettings(LinuxPatchSettingsArgs.builder()
* .assessmentMode("AutomaticByPlatform")
* .automaticByPlatformSettings(LinuxVMGuestPatchAutomaticByPlatformSettingsArgs.builder()
* .bypassPlatformSafetyChecksOnUserSchedule(true)
* .rebootSetting("Never")
* .build())
* .patchMode("AutomaticByPlatform")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("UbuntuServer")
* .publisher("Canonical")
* .sku("16.04-LTS")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Linux vm with a patch setting patchMode of ImageDefault.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2s_v3")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .linuxConfiguration(LinuxConfigurationArgs.builder()
* .patchSettings(LinuxPatchSettingsArgs.builder()
* .patchMode("ImageDefault")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("UbuntuServer")
* .publisher("Canonical")
* .sku("16.04-LTS")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Linux vm with a patch settings patchMode and assessmentMode set to AutomaticByPlatform.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxPatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2s_v3")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .linuxConfiguration(LinuxConfigurationArgs.builder()
* .patchSettings(LinuxPatchSettingsArgs.builder()
* .assessmentMode("AutomaticByPlatform")
* .patchMode("AutomaticByPlatform")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("UbuntuServer")
* .publisher("Canonical")
* .sku("16.04-LTS")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM from a community gallery image
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .communityGalleryImageId("/CommunityGalleries/galleryPublicName/Images/communityGalleryImageName/Versions/communityGalleryImageVersionName")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM from a shared gallery image
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .sharedGalleryImageId("/SharedGalleries/sharedGalleryName/Images/sharedGalleryImageName/Versions/sharedGalleryImageVersionName")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with Disk Controller Type
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D4_v3")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .diskControllerType("NVMe")
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .userData("U29tZSBDdXN0b20gRGF0YQ==")
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with HibernationEnabled
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.AdditionalCapabilitiesArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .additionalCapabilities(AdditionalCapabilitiesArgs.builder()
* .hibernationEnabled(true)
* .build())
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2s_v3")
* .build())
* .location("eastus2euap")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("{vm-name}")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2019-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("vmOSdisk")
* .build())
* .build())
* .vmName("{vm-name}")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with Uefi Settings of secureBoot and vTPM.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
* import com.pulumi.azurenative.compute.inputs.UefiSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2s_v3")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .securityProfile(SecurityProfileArgs.builder()
* .securityType("TrustedLaunch")
* .uefiSettings(UefiSettingsArgs.builder()
* .secureBootEnabled(true)
* .vTpmEnabled(true)
* .build())
* .build())
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windowsserver-gen2preview-preview")
* .publisher("MicrosoftWindowsServer")
* .sku("windows10-tvm")
* .version("18363.592.2001092016")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("StandardSSD_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with UserData
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("{vm-name}")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("vmOSdisk")
* .build())
* .build())
* .userData("RXhhbXBsZSBVc2VyRGF0YQ==")
* .vmName("{vm-name}")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with VM Size Properties
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.VMSizePropertiesArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D4_v3")
* .vmSizeProperties(VMSizePropertiesArgs.builder()
* .vCPUsAvailable(1)
* .vCPUsPerCore(1)
* .build())
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .userData("U29tZSBDdXN0b20gRGF0YQ==")
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with network interface configuration
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkApiVersion("2020-11-01")
* .networkInterfaceConfigurations(VirtualMachineNetworkInterfaceConfigurationArgs.builder()
* .deleteOption("Delete")
* .ipConfigurations(VirtualMachineNetworkInterfaceIPConfigurationArgs.builder()
* .name("{ip-config-name}")
* .primary(true)
* .publicIPAddressConfiguration(VirtualMachinePublicIPAddressConfigurationArgs.builder()
* .deleteOption("Detach")
* .name("{publicIP-config-name}")
* .publicIPAllocationMethod("Static")
* .sku(PublicIPAddressSkuArgs.builder()
* .name("Basic")
* .tier("Global")
* .build())
* .build())
* .build())
* .name("{nic-config-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with securityType ConfidentialVM with Customer Managed Keys
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
* import com.pulumi.azurenative.compute.inputs.UefiSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* import com.pulumi.azurenative.compute.inputs.VMDiskSecurityProfileArgs;
* import com.pulumi.azurenative.compute.inputs.DiskEncryptionSetParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DC2as_v5")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .securityProfile(SecurityProfileArgs.builder()
* .securityType("ConfidentialVM")
* .uefiSettings(UefiSettingsArgs.builder()
* .secureBootEnabled(true)
* .vTpmEnabled(true)
* .build())
* .build())
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("2019-datacenter-cvm")
* .publisher("MicrosoftWindowsServer")
* .sku("windows-cvm")
* .version("17763.2183.2109130127")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .securityProfile(VMDiskSecurityProfileArgs.builder()
* .diskEncryptionSet(DiskEncryptionSetParametersArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")
* .build())
* .securityEncryptionType("DiskWithVMGuestState")
* .build())
* .storageAccountType("StandardSSD_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a VM with securityType ConfidentialVM with Platform Managed Keys
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
* import com.pulumi.azurenative.compute.inputs.UefiSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* import com.pulumi.azurenative.compute.inputs.VMDiskSecurityProfileArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DC2as_v5")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .securityProfile(SecurityProfileArgs.builder()
* .securityType("ConfidentialVM")
* .uefiSettings(UefiSettingsArgs.builder()
* .secureBootEnabled(true)
* .vTpmEnabled(true)
* .build())
* .build())
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("2019-datacenter-cvm")
* .publisher("MicrosoftWindowsServer")
* .sku("windows-cvm")
* .version("17763.2183.2109130127")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .securityProfile(VMDiskSecurityProfileArgs.builder()
* .securityEncryptionType("DiskWithVMGuestState")
* .build())
* .storageAccountType("StandardSSD_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Windows vm with a patch setting assessmentMode of ImageDefault.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .windowsConfiguration(WindowsConfigurationArgs.builder()
* .enableAutomaticUpdates(true)
* .patchSettings(PatchSettingsArgs.builder()
* .assessmentMode("ImageDefault")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Windows vm with a patch setting patchMode of AutomaticByOS.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/nsgExistingNic")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .windowsConfiguration(WindowsConfigurationArgs.builder()
* .enableAutomaticUpdates(true)
* .patchSettings(PatchSettingsArgs.builder()
* .patchMode("AutomaticByOS")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and AutomaticByPlatformSettings.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsVMGuestPatchAutomaticByPlatformSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .windowsConfiguration(WindowsConfigurationArgs.builder()
* .enableAutomaticUpdates(true)
* .patchSettings(PatchSettingsArgs.builder()
* .assessmentMode("AutomaticByPlatform")
* .automaticByPlatformSettings(WindowsVMGuestPatchAutomaticByPlatformSettingsArgs.builder()
* .bypassPlatformSafetyChecksOnUserSchedule(false)
* .rebootSetting("Never")
* .build())
* .patchMode("AutomaticByPlatform")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Windows vm with a patch setting patchMode of AutomaticByPlatform and enableHotpatching set to true.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .windowsConfiguration(WindowsConfigurationArgs.builder()
* .enableAutomaticUpdates(true)
* .patchSettings(PatchSettingsArgs.builder()
* .enableHotpatching(true)
* .patchMode("AutomaticByPlatform")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Windows vm with a patch setting patchMode of Manual.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .windowsConfiguration(WindowsConfigurationArgs.builder()
* .enableAutomaticUpdates(true)
* .patchSettings(PatchSettingsArgs.builder()
* .patchMode("Manual")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a Windows vm with patch settings patchMode and assessmentMode set to AutomaticByPlatform.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.WindowsConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.PatchSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .windowsConfiguration(WindowsConfigurationArgs.builder()
* .enableAutomaticUpdates(true)
* .patchSettings(PatchSettingsArgs.builder()
* .assessmentMode("AutomaticByPlatform")
* .patchMode("AutomaticByPlatform")
* .build())
* .provisionVMAgent(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a custom-image vm from an unmanaged generalized os image.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.VirtualHardDiskArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .image(VirtualHardDiskArgs.builder()
* .uri("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/{existing-generalized-os-image-blob-name}.vhd")
* .build())
* .name("myVMosdisk")
* .osType("Windows")
* .vhd(VirtualHardDiskArgs.builder()
* .uri("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")
* .build())
* .build())
* .build())
* .vmName("{vm-name}")
* .build());
*
* }
* }
*
* }
*
* ### Create a platform-image vm with unmanaged os and data disks.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.VirtualHardDiskArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .dataDisks(
* DataDiskArgs.builder()
* .createOption("Empty")
* .diskSizeGB(1023)
* .lun(0)
* .vhd(VirtualHardDiskArgs.builder()
* .uri("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk0.vhd")
* .build())
* .build(),
* DataDiskArgs.builder()
* .createOption("Empty")
* .diskSizeGB(1023)
* .lun(1)
* .vhd(VirtualHardDiskArgs.builder()
* .uri("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk1.vhd")
* .build())
* .build())
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .name("myVMosdisk")
* .vhd(VirtualHardDiskArgs.builder()
* .uri("http://{existing-storage-account-name}.blob.core.windows.net/{existing-container-name}/myDisk.vhd")
* .build())
* .build())
* .build())
* .vmName("{vm-name}")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm from a custom image.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm from a generalized shared image.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm from a specialized shared image.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/galleries/mySharedGallery/images/mySharedImage")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm in a Virtual Machine Scale Set with customer assigned platformFaultDomain.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* import com.pulumi.azurenative.compute.inputs.SubResourceArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .platformFaultDomain(1)
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .virtualMachineScaleSet(SubResourceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/virtualMachineScaleSets/{existing-flex-vmss-name-with-platformFaultDomainCount-greater-than-1}")
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm in an availability set.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.SubResourceArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .availabilitySet(SubResourceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/availabilitySets/{existing-availability-set-name}")
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with Application Profile.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.ApplicationProfileArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .applicationProfile(ApplicationProfileArgs.builder()
* .galleryApplications(
* VMGalleryApplicationArgs.builder()
* .configurationReference("https://mystorageaccount.blob.core.windows.net/configurations/settings.config")
* .enableAutomaticUpgrade(false)
* .order(1)
* .packageReferenceId("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdb/resourceGroups/myresourceGroupName2/providers/Microsoft.Compute/galleries/myGallery1/applications/MyApplication1/versions/1.0")
* .tags("myTag1")
* .treatFailureAsDeploymentFailure(false)
* .build(),
* VMGalleryApplicationArgs.builder()
* .packageReferenceId("/subscriptions/32c17a9e-aa7b-4ba5-a45b-e324116b6fdg/resourceGroups/myresourceGroupName3/providers/Microsoft.Compute/galleries/myGallery2/applications/MyApplication2/versions/1.1")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("{image_offer}")
* .publisher("{image_publisher}")
* .sku("{image_sku}")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with DiskEncryptionSet resource id in the os disk and data disk.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* import com.pulumi.azurenative.compute.inputs.DiskEncryptionSetParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .dataDisks(
* DataDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("Empty")
* .diskSizeGB(1023)
* .lun(0)
* .managedDisk(ManagedDiskParametersArgs.builder()
* .diskEncryptionSet(DiskEncryptionSetParametersArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")
* .build())
* .storageAccountType("Standard_LRS")
* .build())
* .build(),
* DataDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("Attach")
* .diskSizeGB(1023)
* .lun(1)
* .managedDisk(ManagedDiskParametersArgs.builder()
* .diskEncryptionSet(DiskEncryptionSetParametersArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")
* .build())
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/disks/{existing-managed-disk-name}")
* .storageAccountType("Standard_LRS")
* .build())
* .build())
* .imageReference(ImageReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/images/{existing-custom-image-name}")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .diskEncryptionSet(DiskEncryptionSetParametersArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/diskEncryptionSets/{existing-diskEncryptionSet-name}")
* .build())
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with Host Encryption using encryptionAtHost property.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.PlanArgs;
* import com.pulumi.azurenative.compute.inputs.SecurityProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DS1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .plan(PlanArgs.builder()
* .name("windows2016")
* .product("windows-data-science-vm")
* .publisher("microsoft-ads")
* .build())
* .resourceGroupName("myResourceGroup")
* .securityProfile(SecurityProfileArgs.builder()
* .encryptionAtHost(true)
* .build())
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windows-data-science-vm")
* .publisher("microsoft-ads")
* .sku("windows2016")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with Scheduled Events Profile
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ScheduledEventsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSImageNotificationProfileArgs;
* import com.pulumi.azurenative.compute.inputs.TerminateNotificationProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .scheduledEventsProfile(ScheduledEventsProfileArgs.builder()
* .osImageNotificationProfile(OSImageNotificationProfileArgs.builder()
* .enable(true)
* .notBeforeTimeout("PT15M")
* .build())
* .terminateNotificationProfile(TerminateNotificationProfileArgs.builder()
* .enable(true)
* .notBeforeTimeout("PT10M")
* .build())
* .build())
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with a marketplace image plan.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.PlanArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .plan(PlanArgs.builder()
* .name("windows2016")
* .product("windows-data-science-vm")
* .publisher("microsoft-ads")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windows-data-science-vm")
* .publisher("microsoft-ads")
* .sku("windows2016")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with an extensions time budget.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .extensionsTimeBudget("PT30M")
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with boot diagnostics.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .storageUri("http://{existing-storage-account-name}.blob.core.windows.net")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with empty data disks.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D2_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .dataDisks(
* DataDiskArgs.builder()
* .createOption("Empty")
* .diskSizeGB(1023)
* .lun(0)
* .build(),
* DataDiskArgs.builder()
* .createOption("Empty")
* .diskSizeGB(1023)
* .lun(1)
* .build())
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with ephemeral os disk provisioning in Cache disk using placement property.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.PlanArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.DiffDiskSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DS1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .plan(PlanArgs.builder()
* .name("windows2016")
* .product("windows-data-science-vm")
* .publisher("microsoft-ads")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windows-data-science-vm")
* .publisher("microsoft-ads")
* .sku("windows2016")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .diffDiskSettings(DiffDiskSettingsArgs.builder()
* .option("Local")
* .placement("CacheDisk")
* .build())
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with ephemeral os disk provisioning in Resource disk using placement property.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.PlanArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.DiffDiskSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DS1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .plan(PlanArgs.builder()
* .name("windows2016")
* .product("windows-data-science-vm")
* .publisher("microsoft-ads")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windows-data-science-vm")
* .publisher("microsoft-ads")
* .sku("windows2016")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .diffDiskSettings(DiffDiskSettingsArgs.builder()
* .option("Local")
* .placement("ResourceDisk")
* .build())
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with ephemeral os disk.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.PlanArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.DiffDiskSettingsArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DS1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .plan(PlanArgs.builder()
* .name("windows2016")
* .product("windows-data-science-vm")
* .publisher("microsoft-ads")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windows-data-science-vm")
* .publisher("microsoft-ads")
* .sku("windows2016")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .diffDiskSettings(DiffDiskSettingsArgs.builder()
* .option("Local")
* .build())
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with managed boot diagnostics.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.DiagnosticsProfileArgs;
* import com.pulumi.azurenative.compute.inputs.BootDiagnosticsArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .diagnosticsProfile(DiagnosticsProfileArgs.builder()
* .bootDiagnostics(BootDiagnosticsArgs.builder()
* .enabled(true)
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with password authentication.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with premium storage.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("WindowsServer")
* .publisher("MicrosoftWindowsServer")
* .sku("2016-Datacenter")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Premium_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create a vm with ssh authentication.
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.LinuxConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.SshConfigurationArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_D1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminUsername("{your-username}")
* .computerName("myVM")
* .linuxConfiguration(LinuxConfigurationArgs.builder()
* .disablePasswordAuthentication(true)
* .ssh(SshConfigurationArgs.builder()
* .publicKeys(SshPublicKeyArgs.builder()
* .keyData("ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCeClRAk2ipUs/l5voIsDC5q9RI+YSRd1Bvd/O+axgY4WiBzG+4FwJWZm/mLLe5DoOdHQwmU2FrKXZSW4w2sYE70KeWnrFViCOX5MTVvJgPE8ClugNl8RWth/tU849DvM9sT7vFgfVSHcAS2yDRyDlueii+8nF2ym8XWAPltFVCyLHRsyBp5YPqK8JFYIa1eybKsY3hEAxRCA+/7bq8et+Gj3coOsuRmrehav7rE6N12Pb80I6ofa6SM5XNYq4Xk0iYNx7R3kdz0Jj9XgZYWjAHjJmT0gTRoOnt6upOuxK7xI/ykWrllgpXrCPu3Ymz+c+ujaqcxDopnAl2lmf69/J1")
* .path("/home/{your-username}/.ssh/authorized_keys")
* .build())
* .build())
* .build())
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("{image_offer}")
* .publisher("{image_publisher}")
* .sku("{image_sku}")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadWrite")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
* ### Create or update a VM with capacity reservation
*
*
* {@code
* package generated_program;
*
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azurenative.compute.VirtualMachine;
* import com.pulumi.azurenative.compute.VirtualMachineArgs;
* import com.pulumi.azurenative.compute.inputs.CapacityReservationProfileArgs;
* import com.pulumi.azurenative.compute.inputs.SubResourceArgs;
* import com.pulumi.azurenative.compute.inputs.HardwareProfileArgs;
* import com.pulumi.azurenative.compute.inputs.NetworkProfileArgs;
* import com.pulumi.azurenative.compute.inputs.OSProfileArgs;
* import com.pulumi.azurenative.compute.inputs.PlanArgs;
* import com.pulumi.azurenative.compute.inputs.StorageProfileArgs;
* import com.pulumi.azurenative.compute.inputs.ImageReferenceArgs;
* import com.pulumi.azurenative.compute.inputs.OSDiskArgs;
* import com.pulumi.azurenative.compute.inputs.ManagedDiskParametersArgs;
* 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()
* .capacityReservation(CapacityReservationProfileArgs.builder()
* .capacityReservationGroup(SubResourceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Compute/CapacityReservationGroups/{crgName}")
* .build())
* .build())
* .hardwareProfile(HardwareProfileArgs.builder()
* .vmSize("Standard_DS1_v2")
* .build())
* .location("westus")
* .networkProfile(NetworkProfileArgs.builder()
* .networkInterfaces(NetworkInterfaceReferenceArgs.builder()
* .id("/subscriptions/{subscription-id}/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkInterfaces/{existing-nic-name}")
* .primary(true)
* .build())
* .build())
* .osProfile(OSProfileArgs.builder()
* .adminPassword("{your-password}")
* .adminUsername("{your-username}")
* .computerName("myVM")
* .build())
* .plan(PlanArgs.builder()
* .name("windows2016")
* .product("windows-data-science-vm")
* .publisher("microsoft-ads")
* .build())
* .resourceGroupName("myResourceGroup")
* .storageProfile(StorageProfileArgs.builder()
* .imageReference(ImageReferenceArgs.builder()
* .offer("windows-data-science-vm")
* .publisher("microsoft-ads")
* .sku("windows2016")
* .version("latest")
* .build())
* .osDisk(OSDiskArgs.builder()
* .caching("ReadOnly")
* .createOption("FromImage")
* .managedDisk(ManagedDiskParametersArgs.builder()
* .storageAccountType("Standard_LRS")
* .build())
* .name("myVMosdisk")
* .build())
* .build())
* .vmName("myVM")
* .build());
*
* }
* }
*
* }
*
*
* ## Import
*
* An existing resource can be imported using its type token, name, and identifier, e.g.
*
* ```sh
* $ pulumi import azure-native:compute:VirtualMachine myVM /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
* ```
*
*/
@ResourceType(type="azure-native:compute:VirtualMachine")
public class VirtualMachine extends com.pulumi.resources.CustomResource {
/**
* Specifies additional capabilities enabled or disabled on the virtual machine.
*
*/
@Export(name="additionalCapabilities", refs={AdditionalCapabilitiesResponse.class}, tree="[0]")
private Output* @Nullable */ AdditionalCapabilitiesResponse> additionalCapabilities;
/**
* @return Specifies additional capabilities enabled or disabled on the virtual machine.
*
*/
public Output> additionalCapabilities() {
return Codegen.optional(this.additionalCapabilities);
}
/**
* Specifies the gallery applications that should be made available to the VM/VMSS.
*
*/
@Export(name="applicationProfile", refs={ApplicationProfileResponse.class}, tree="[0]")
private Output* @Nullable */ ApplicationProfileResponse> applicationProfile;
/**
* @return Specifies the gallery applications that should be made available to the VM/VMSS.
*
*/
public Output> applicationProfile() {
return Codegen.optional(this.applicationProfile);
}
/**
* Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.
*
*/
@Export(name="availabilitySet", refs={SubResourceResponse.class}, tree="[0]")
private Output* @Nullable */ SubResourceResponse> availabilitySet;
/**
* @return Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). Currently, a VM can only be added to availability set at creation time. The availability set to which the VM is being added should be under the same resource group as the availability set resource. An existing VM cannot be added to an availability set. This property cannot exist along with a non-null properties.virtualMachineScaleSet reference.
*
*/
public Output> availabilitySet() {
return Codegen.optional(this.availabilitySet);
}
/**
* Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01.
*
*/
@Export(name="billingProfile", refs={BillingProfileResponse.class}, tree="[0]")
private Output* @Nullable */ BillingProfileResponse> billingProfile;
/**
* @return Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01.
*
*/
public Output> billingProfile() {
return Codegen.optional(this.billingProfile);
}
/**
* Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01.
*
*/
@Export(name="capacityReservation", refs={CapacityReservationProfileResponse.class}, tree="[0]")
private Output* @Nullable */ CapacityReservationProfileResponse> capacityReservation;
/**
* @return Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01.
*
*/
public Output> capacityReservation() {
return Codegen.optional(this.capacityReservation);
}
/**
* Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
*
*/
@Export(name="diagnosticsProfile", refs={DiagnosticsProfileResponse.class}, tree="[0]")
private Output* @Nullable */ DiagnosticsProfileResponse> diagnosticsProfile;
/**
* @return Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
*
*/
public Output> diagnosticsProfile() {
return Codegen.optional(this.diagnosticsProfile);
}
/**
* Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.
*
*/
@Export(name="evictionPolicy", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> evictionPolicy;
/**
* @return Specifies the eviction policy for the Azure Spot virtual machine and Azure Spot scale set. For Azure Spot virtual machines, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2019-03-01. For Azure Spot scale sets, both 'Deallocate' and 'Delete' are supported and the minimum api-version is 2017-10-30-preview.
*
*/
public Output> evictionPolicy() {
return Codegen.optional(this.evictionPolicy);
}
/**
* The extended location of the Virtual Machine.
*
*/
@Export(name="extendedLocation", refs={ExtendedLocationResponse.class}, tree="[0]")
private Output* @Nullable */ ExtendedLocationResponse> extendedLocation;
/**
* @return The extended location of the Virtual Machine.
*
*/
public Output> extendedLocation() {
return Codegen.optional(this.extendedLocation);
}
/**
* Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). Minimum api-version: 2020-06-01.
*
*/
@Export(name="extensionsTimeBudget", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> extensionsTimeBudget;
/**
* @return Specifies the time alloted for all extensions to start. The time duration should be between 15 minutes and 120 minutes (inclusive) and should be specified in ISO 8601 format. The default value is 90 minutes (PT1H30M). Minimum api-version: 2020-06-01.
*
*/
public Output> extensionsTimeBudget() {
return Codegen.optional(this.extensionsTimeBudget);
}
/**
* Specifies the hardware settings for the virtual machine.
*
*/
@Export(name="hardwareProfile", refs={HardwareProfileResponse.class}, tree="[0]")
private Output* @Nullable */ HardwareProfileResponse> hardwareProfile;
/**
* @return Specifies the hardware settings for the virtual machine.
*
*/
public Output> hardwareProfile() {
return Codegen.optional(this.hardwareProfile);
}
/**
* Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01.
*
*/
@Export(name="host", refs={SubResourceResponse.class}, tree="[0]")
private Output* @Nullable */ SubResourceResponse> host;
/**
* @return Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01.
*
*/
public Output> host() {
return Codegen.optional(this.host);
}
/**
* Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01.
*
*/
@Export(name="hostGroup", refs={SubResourceResponse.class}, tree="[0]")
private Output* @Nullable */ SubResourceResponse> hostGroup;
/**
* @return Specifies information about the dedicated host group that the virtual machine resides in. **Note:** User cannot specify both host and hostGroup properties. Minimum api-version: 2020-06-01.
*
*/
public Output> hostGroup() {
return Codegen.optional(this.hostGroup);
}
/**
* The identity of the virtual machine, if configured.
*
*/
@Export(name="identity", refs={VirtualMachineIdentityResponse.class}, tree="[0]")
private Output* @Nullable */ VirtualMachineIdentityResponse> identity;
/**
* @return The identity of the virtual machine, if configured.
*
*/
public Output> identity() {
return Codegen.optional(this.identity);
}
/**
* The virtual machine instance view.
*
*/
@Export(name="instanceView", refs={VirtualMachineInstanceViewResponse.class}, tree="[0]")
private Output instanceView;
/**
* @return The virtual machine instance view.
*
*/
public Output instanceView() {
return this.instanceView;
}
/**
* Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15
*
*/
@Export(name="licenseType", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> licenseType;
/**
* @return Specifies that the image or disk that is being used was licensed on-premises. <br><br> Possible values for Windows Server operating system are: <br><br> Windows_Client <br><br> Windows_Server <br><br> Possible values for Linux Server operating system are: <br><br> RHEL_BYOS (for RHEL) <br><br> SLES_BYOS (for SUSE) <br><br> For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/windows/hybrid-use-benefit-licensing) <br><br> [Azure Hybrid Use Benefit for Linux Server](https://docs.microsoft.com/azure/virtual-machines/linux/azure-hybrid-benefit-linux) <br><br> Minimum api-version: 2015-06-15
*
*/
public Output> licenseType() {
return Codegen.optional(this.licenseType);
}
/**
* Resource location
*
*/
@Export(name="location", refs={String.class}, tree="[0]")
private Output location;
/**
* @return Resource location
*
*/
public Output location() {
return this.location;
}
/**
* Resource name
*
*/
@Export(name="name", refs={String.class}, tree="[0]")
private Output name;
/**
* @return Resource name
*
*/
public Output name() {
return this.name;
}
/**
* Specifies the network interfaces of the virtual machine.
*
*/
@Export(name="networkProfile", refs={NetworkProfileResponse.class}, tree="[0]")
private Output* @Nullable */ NetworkProfileResponse> networkProfile;
/**
* @return Specifies the network interfaces of the virtual machine.
*
*/
public Output> networkProfile() {
return Codegen.optional(this.networkProfile);
}
/**
* Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.
*
*/
@Export(name="osProfile", refs={OSProfileResponse.class}, tree="[0]")
private Output* @Nullable */ OSProfileResponse> osProfile;
/**
* @return Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.
*
*/
public Output> osProfile() {
return Codegen.optional(this.osProfile);
}
/**
* Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
*
*/
@Export(name="plan", refs={PlanResponse.class}, tree="[0]")
private Output* @Nullable */ PlanResponse> plan;
/**
* @return Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
*
*/
public Output> plan() {
return Codegen.optional(this.plan);
}
/**
* Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01.
*
*/
@Export(name="platformFaultDomain", refs={Integer.class}, tree="[0]")
private Output* @Nullable */ Integer> platformFaultDomain;
/**
* @return Specifies the scale set logical fault domain into which the Virtual Machine will be created. By default, the Virtual Machine will by automatically assigned to a fault domain that best maintains balance across available fault domains. This is applicable only if the 'virtualMachineScaleSet' property of this Virtual Machine is set. The Virtual Machine Scale Set that is referenced, must have 'platformFaultDomainCount' greater than 1. This property cannot be updated once the Virtual Machine is created. Fault domain assignment can be viewed in the Virtual Machine Instance View. Minimum api‐version: 2020‐12‐01.
*
*/
public Output> platformFaultDomain() {
return Codegen.optional(this.platformFaultDomain);
}
/**
* Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01
*
*/
@Export(name="priority", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> priority;
/**
* @return Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01
*
*/
public Output> priority() {
return Codegen.optional(this.priority);
}
/**
* The provisioning state, which only appears in the response.
*
*/
@Export(name="provisioningState", refs={String.class}, tree="[0]")
private Output provisioningState;
/**
* @return The provisioning state, which only appears in the response.
*
*/
public Output provisioningState() {
return this.provisioningState;
}
/**
* Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01.
*
*/
@Export(name="proximityPlacementGroup", refs={SubResourceResponse.class}, tree="[0]")
private Output* @Nullable */ SubResourceResponse> proximityPlacementGroup;
/**
* @return Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01.
*
*/
public Output> proximityPlacementGroup() {
return Codegen.optional(this.proximityPlacementGroup);
}
/**
* The virtual machine child extension resources.
*
*/
@Export(name="resources", refs={List.class,VirtualMachineExtensionResponse.class}, tree="[0,1]")
private Output> resources;
/**
* @return The virtual machine child extension resources.
*
*/
public Output> resources() {
return this.resources;
}
/**
* Specifies Scheduled Event related configurations.
*
*/
@Export(name="scheduledEventsProfile", refs={ScheduledEventsProfileResponse.class}, tree="[0]")
private Output* @Nullable */ ScheduledEventsProfileResponse> scheduledEventsProfile;
/**
* @return Specifies Scheduled Event related configurations.
*
*/
public Output> scheduledEventsProfile() {
return Codegen.optional(this.scheduledEventsProfile);
}
/**
* Specifies the Security related profile settings for the virtual machine.
*
*/
@Export(name="securityProfile", refs={SecurityProfileResponse.class}, tree="[0]")
private Output* @Nullable */ SecurityProfileResponse> securityProfile;
/**
* @return Specifies the Security related profile settings for the virtual machine.
*
*/
public Output> securityProfile() {
return Codegen.optional(this.securityProfile);
}
/**
* Specifies the storage settings for the virtual machine disks.
*
*/
@Export(name="storageProfile", refs={StorageProfileResponse.class}, tree="[0]")
private Output* @Nullable */ StorageProfileResponse> storageProfile;
/**
* @return Specifies the storage settings for the virtual machine disks.
*
*/
public Output> storageProfile() {
return Codegen.optional(this.storageProfile);
}
/**
* Resource tags
*
*/
@Export(name="tags", refs={Map.class,String.class}, tree="[0,1,1]")
private Output* @Nullable */ Map> tags;
/**
* @return Resource tags
*
*/
public Output>> tags() {
return Codegen.optional(this.tags);
}
/**
* Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.
*
*/
@Export(name="timeCreated", refs={String.class}, tree="[0]")
private Output timeCreated;
/**
* @return Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.
*
*/
public Output timeCreated() {
return this.timeCreated;
}
/**
* Resource type
*
*/
@Export(name="type", refs={String.class}, tree="[0]")
private Output type;
/**
* @return Resource type
*
*/
public Output type() {
return this.type;
}
/**
* UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.
*
*/
@Export(name="userData", refs={String.class}, tree="[0]")
private Output* @Nullable */ String> userData;
/**
* @return UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.
*
*/
public Output> userData() {
return Codegen.optional(this.userData);
}
/**
* Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01.
*
*/
@Export(name="virtualMachineScaleSet", refs={SubResourceResponse.class}, tree="[0]")
private Output* @Nullable */ SubResourceResponse> virtualMachineScaleSet;
/**
* @return Specifies information about the virtual machine scale set that the virtual machine should be assigned to. Virtual machines specified in the same virtual machine scale set are allocated to different nodes to maximize availability. Currently, a VM can only be added to virtual machine scale set at creation time. An existing VM cannot be added to a virtual machine scale set. This property cannot exist along with a non-null properties.availabilitySet reference. Minimum api‐version: 2019‐03‐01.
*
*/
public Output> virtualMachineScaleSet() {
return Codegen.optional(this.virtualMachineScaleSet);
}
/**
* Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.
*
*/
@Export(name="vmId", refs={String.class}, tree="[0]")
private Output vmId;
/**
* @return Specifies the VM unique ID which is a 128-bits identifier that is encoded and stored in all Azure IaaS VMs SMBIOS and can be read using platform BIOS commands.
*
*/
public Output vmId() {
return this.vmId;
}
/**
* The virtual machine zones.
*
*/
@Export(name="zones", refs={List.class,String.class}, tree="[0,1]")
private Output* @Nullable */ List> zones;
/**
* @return The virtual machine zones.
*
*/
public Output>> zones() {
return Codegen.optional(this.zones);
}
/**
*
* @param name The _unique_ name of the resulting resource.
*/
public VirtualMachine(java.lang.String name) {
this(name, VirtualMachineArgs.Empty);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
*/
public VirtualMachine(java.lang.String name, VirtualMachineArgs args) {
this(name, args, null);
}
/**
*
* @param name The _unique_ name of the resulting resource.
* @param args The arguments to use to populate this resource's properties.
* @param options A bag of options that control this resource's behavior.
*/
public VirtualMachine(java.lang.String name, VirtualMachineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:compute:VirtualMachine", name, makeArgs(args, options), makeResourceOptions(options, Codegen.empty()), false);
}
private VirtualMachine(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
super("azure-native:compute:VirtualMachine", name, null, makeResourceOptions(options, id), false);
}
private static VirtualMachineArgs makeArgs(VirtualMachineArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options) {
if (options != null && options.getUrn().isPresent()) {
return null;
}
return args == null ? VirtualMachineArgs.Empty : args;
}
private static com.pulumi.resources.CustomResourceOptions makeResourceOptions(@Nullable com.pulumi.resources.CustomResourceOptions options, @Nullable Output id) {
var defaultOptions = com.pulumi.resources.CustomResourceOptions.builder()
.version(Utilities.getVersion())
.aliases(List.of(
Output.of(Alias.builder().type("azure-native:compute/v20150615:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20160330:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20160430preview:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20170330:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20171201:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20180401:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20180601:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20181001:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20190301:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20190701:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20191201:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20200601:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20201201:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20210301:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20210401:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20210701:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20211101:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20220301:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20220801:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20221101:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20230301:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20230701:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20230901:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20240301:VirtualMachine").build()),
Output.of(Alias.builder().type("azure-native:compute/v20240701:VirtualMachine").build())
))
.build();
return com.pulumi.resources.CustomResourceOptions.merge(defaultOptions, options, id);
}
/**
* Get an existing Host resource's state with the given name, ID, and optional extra
* properties used to qualify the lookup.
*
* @param name The _unique_ name of the resulting resource.
* @param id The _unique_ provider ID of the resource to lookup.
* @param options Optional settings to control the behavior of the CustomResource.
*/
public static VirtualMachine get(java.lang.String name, Output id, @Nullable com.pulumi.resources.CustomResourceOptions options) {
return new VirtualMachine(name, id, options);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy