import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Manages a Windows Virtual Machine. * * ## Disclaimers * * > **Note** This provider will automatically remove the OS Disk by default - this behaviour can be configured using the `features` setting within the Provider block. * * > **Note** All arguments including the administrator login and password will be stored in the raw state as plain-text. * * > **Note** This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the `azure.compute.VirtualMachine` resource instead. * * > **Note** This resource does not support attaching existing OS Disks. You can instead capture an image of the OS Disk or continue to use the `azure.compute.VirtualMachine` resource instead. * * > In this release there's a known issue where the `publicIpAddress` and `publicIpAddresses` fields may not be fully populated for Dynamic Public IP's. * * ## Example Usage * * This example provisions a basic Windows Virtual Machine on an internal network. * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as azure from "@pulumi/azure"; * * const example = new azure.core.ResourceGroup("example", { * name: "example-resources", * location: "West Europe", * }); * const exampleVirtualNetwork = new azure.network.VirtualNetwork("example", { * name: "example-network", * addressSpaces: ["10.0.0.0/16"], * location: example.location, * resourceGroupName: example.name, * }); * const exampleSubnet = new azure.network.Subnet("example", { * name: "internal", * resourceGroupName: example.name, * virtualNetworkName: exampleVirtualNetwork.name, * addressPrefixes: ["10.0.2.0/24"], * }); * const exampleNetworkInterface = new azure.network.NetworkInterface("example", { * name: "example-nic", * location: example.location, * resourceGroupName: example.name, * ipConfigurations: [{ * name: "internal", * subnetId: exampleSubnet.id, * privateIpAddressAllocation: "Dynamic", * }], * }); * const exampleWindowsVirtualMachine = new azure.compute.WindowsVirtualMachine("example", { * name: "example-machine", * resourceGroupName: example.name, * location: example.location, * size: "Standard_F2", * adminUsername: "adminuser", * adminPassword: "P@$$w0rd1234!", * networkInterfaceIds: [exampleNetworkInterface.id], * osDisk: { * caching: "ReadWrite", * storageAccountType: "Standard_LRS", * }, * sourceImageReference: { * publisher: "MicrosoftWindowsServer", * offer: "WindowsServer", * sku: "2016-Datacenter", * version: "latest", * }, * }); * ``` * * ## API Providers * * * This resource uses the following Azure API Providers: * * * `Microsoft.Compute` - 2024-03-01, 2023-04-02 * * ## Import * * Windows Virtual Machines can be imported using the `resource id`, e.g. * * ```sh * $ pulumi import azure:compute/windowsVirtualMachine:WindowsVirtualMachine example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/mygroup1/providers/Microsoft.Compute/virtualMachines/machine1 * ``` */ export declare class WindowsVirtualMachine extends pulumi.CustomResource { /** * Get an existing WindowsVirtualMachine 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 state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input, state?: WindowsVirtualMachineState, opts?: pulumi.CustomResourceOptions): WindowsVirtualMachine; /** * Returns true if the given object is an instance of WindowsVirtualMachine. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is WindowsVirtualMachine; /** * A `additionalCapabilities` block as defined below. */ readonly additionalCapabilities: pulumi.Output; /** * One or more `additionalUnattendContent` blocks as defined below. Changing this forces a new resource to be created. */ readonly additionalUnattendContents: pulumi.Output; /** * The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`. */ readonly adminPassword: pulumi.Output; /** * The username of the local administrator used for the Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`. */ readonly adminUsername: pulumi.Output; /** * Should Extension Operations be allowed on this Virtual Machine? Defaults to `true`. */ readonly allowExtensionOperations: pulumi.Output; /** * Specifies if Automatic Updates are Enabled for the Windows Virtual Machine. Changing this forces a new resource to be created. Defaults to `true`. */ readonly automaticUpdatesEnabled: pulumi.Output; /** * Specifies the ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created. */ readonly availabilitySetId: pulumi.Output; /** * A `bootDiagnostics` block as defined below. */ readonly bootDiagnostics: pulumi.Output; /** * Specifies whether to skip platform scheduled patching when a user schedule is associated with the VM. Defaults to `false`. * * > **NOTE:** `bypassPlatformSafetyChecksOnUserScheduleEnabled` can only be set to `true` when `patchMode` is set to `AutomaticByPlatform`. */ readonly bypassPlatformSafetyChecksOnUserScheduleEnabled: pulumi.Output; /** * Specifies the ID of the Capacity Reservation Group which the Virtual Machine should be allocated to. * * > **NOTE:** `capacityReservationGroupId` cannot be used with `availabilitySetId` or `proximityPlacementGroupId` */ readonly capacityReservationGroupId: pulumi.Output; /** * Specifies the Hostname which should be used for this Virtual Machine. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerName`, then you must specify `computerName`. Changing this forces a new resource to be created. */ readonly computerName: pulumi.Output; /** * The Base64-Encoded Custom Data which should be used for this Virtual Machine. Changing this forces a new resource to be created. */ readonly customData: pulumi.Output; /** * The ID of a Dedicated Host Group that this Windows Virtual Machine should be run within. Conflicts with `dedicatedHostId`. */ readonly dedicatedHostGroupId: pulumi.Output; /** * The ID of a Dedicated Host where this machine should be run on. Conflicts with `dedicatedHostGroupId`. */ readonly dedicatedHostId: pulumi.Output; /** * Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`. */ readonly diskControllerType: pulumi.Output; /** * Specifies the Edge Zone within the Azure Region where this Windows Virtual Machine should exist. Changing this forces a new Windows Virtual Machine to be created. */ readonly edgeZone: pulumi.Output; /** * @deprecated this property has been deprecated in favour of automaticUpdatesEnabled and will be removed in 5.0 of the provider. */ readonly enableAutomaticUpdates: pulumi.Output; /** * Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? */ readonly encryptionAtHostEnabled: pulumi.Output; /** * Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. * * > **NOTE:** This can only be configured when `priority` is set to `Spot`. */ readonly evictionPolicy: pulumi.Output; /** * Specifies the duration allocated 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. Defaults to `PT1H30M`. */ readonly extensionsTimeBudget: pulumi.Output; /** * One or more `galleryApplication` blocks as defined below. * * > **Note** Gallery Application Assignments can be defined either directly on `azure.compute.WindowsVirtualMachine` resource, or using the `azure.compute.GalleryApplicationAssignment` resource - but the two approaches cannot be used together. If both are used with the same Virtual Machine, spurious changes will occur. If `azure.compute.GalleryApplicationAssignment` is used, it's recommended to use `ignoreChanges` for the `galleryApplication` block on the corresponding `azure.compute.WindowsVirtualMachine` resource, to avoid a persistent diff when using this resource. */ readonly galleryApplications: pulumi.Output; /** * Should the VM be patched without requiring a reboot? Possible values are `true` or `false`. Defaults to `false`. For more information about hot patching please see the [product documentation](https://docs.microsoft.com/azure/automanage/automanage-hotpatch). * * > **NOTE:** Hotpatching can only be enabled if the `patchMode` is set to `AutomaticByPlatform`, the `provisionVmAgent` is set to `true`, your `sourceImageReference` references a hotpatching enabled image, and the VM's `size` is set to a [Azure generation 2](https://docs.microsoft.com/azure/virtual-machines/generation-2#generation-2-vm-sizes) VM. An example of how to correctly configure a Windows Virtual Machine to use the `hotpatchingEnabled` field can be found in the `./examples/virtual-machines/windows/hotpatching-enabled` directory within the GitHub Repository. */ readonly hotpatchingEnabled: pulumi.Output; /** * An `identity` block as defined below. */ readonly identity: pulumi.Output; /** * Specifies the type of on-premise license (also known as [Azure Hybrid Use Benefit](https://docs.microsoft.com/windows-server/get-started/azure-hybrid-benefit)) which should be used for this Virtual Machine. Possible values are `None`, `Windows_Client` and `Windows_Server`. */ readonly licenseType: pulumi.Output; /** * The Azure location where the Windows Virtual Machine should exist. Changing this forces a new resource to be created. */ readonly location: pulumi.Output; /** * The maximum price you're willing to pay for this Virtual Machine, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machine will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that the Virtual Machine should not be evicted for price reasons. * * > **NOTE:** This can only be configured when `priority` is set to `Spot`. */ readonly maxBidPrice: pulumi.Output; /** * The name of the Windows Virtual Machine. Changing this forces a new resource to be created. */ readonly name: pulumi.Output; /** * . A list of Network Interface IDs which should be attached to this Virtual Machine. The first Network Interface ID in this list will be the Primary Network Interface on the Virtual Machine. */ readonly networkInterfaceIds: pulumi.Output; /** * An `osDisk` block as defined below. */ readonly osDisk: pulumi.Output; /** * A `osImageNotification` block as defined below. */ readonly osImageNotification: pulumi.Output; /** * The ID of an existing Managed Disk to use as the OS Disk for this Windows Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** When specifying an existing Managed Disk it is not currently possible to subsequently manage the Operating System Profile properties: `adminUsername`, `adminPassword`, `bypassPlatformSafetyChecksOnUserScheduleEnabled`, `computerName`, `customData`, `provisionVmAgent`, `patchMode`, `patchAssessmentMode`, or `rebootSetting`. */ readonly osManagedDiskId: pulumi.Output; /** * Specifies the mode of VM Guest Patching for the Virtual Machine. Possible values are `AutomaticByPlatform` or `ImageDefault`. Defaults to `ImageDefault`. * * > **NOTE:** If the `patchAssessmentMode` is set to `AutomaticByPlatform` then the `provisionVmAgent` field must be set to `true`. */ readonly patchAssessmentMode: pulumi.Output; /** * Specifies the mode of in-guest patching to this Windows Virtual Machine. Possible values are `Manual`, `AutomaticByOS` and `AutomaticByPlatform`. Defaults to `AutomaticByOS`. For more information on patch modes please see the [product documentation](https://docs.microsoft.com/azure/virtual-machines/automatic-vm-guest-patching#patch-orchestration-modes). * * > **NOTE:** If `patchMode` is set to `AutomaticByPlatform` then `provisionVmAgent` must also be set to `true`. If the Virtual Machine is using a hotpatching enabled image the `patchMode` must always be set to `AutomaticByPlatform`. */ readonly patchMode: pulumi.Output; /** * A `plan` block as defined below. Changing this forces a new resource to be created. */ readonly plan: pulumi.Output; /** * Specifies the Platform Fault Domain in which this Windows Virtual Machine should be created. Defaults to `-1`, which means this will be automatically assigned to a fault domain that best maintains balance across the available fault domains. Changing this forces a new Windows Virtual Machine to be created. */ readonly platformFaultDomain: pulumi.Output; /** * Specifies the priority of this Virtual Machine. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this forces a new resource to be created. */ readonly priority: pulumi.Output; /** * The Primary Private IP Address assigned to this Virtual Machine. */ readonly privateIpAddress: pulumi.Output; /** * A list of Private IP Addresses assigned to this Virtual Machine. */ readonly privateIpAddresses: pulumi.Output; /** * Should the Azure VM Agent be provisioned on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created. * * > **NOTE:** If `provisionVmAgent` is set to `false` then `allowExtensionOperations` must also be set to `false`. */ readonly provisionVmAgent: pulumi.Output; /** * The ID of the Proximity Placement Group which the Virtual Machine should be assigned to. */ readonly proximityPlacementGroupId: pulumi.Output; /** * The Primary Public IP Address assigned to this Virtual Machine. */ readonly publicIpAddress: pulumi.Output; /** * A list of the Public IP Addresses assigned to this Virtual Machine. */ readonly publicIpAddresses: pulumi.Output; /** * Specifies the reboot setting for platform scheduled patching. Possible values are `Always`, `IfRequired` and `Never`. * * > **NOTE:** `rebootSetting` can only be set when `patchMode` is set to `AutomaticByPlatform`. */ readonly rebootSetting: pulumi.Output; /** * The name of the Resource Group in which the Windows Virtual Machine should be exist. Changing this forces a new resource to be created. */ readonly resourceGroupName: pulumi.Output; /** * One or more `secret` blocks as defined below. */ readonly secrets: pulumi.Output; /** * Specifies if Secure Boot and Trusted Launch is enabled for the Virtual Machine. Changing this forces a new resource to be created. */ readonly secureBootEnabled: pulumi.Output; /** * The SKU which should be used for this Virtual Machine, such as `Standard_F2`. */ readonly size: pulumi.Output; /** * The ID of the Image which this Virtual Machine should be created from. Changing this forces a new resource to be created. Possible Image ID types include `Image ID`s, `Shared Image ID`s, `Shared Image Version ID`s, `Community Gallery Image ID`s, `Community Gallery Image Version ID`s, `Shared Gallery Image ID`s and `Shared Gallery Image Version ID`s. * * > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set. */ readonly sourceImageId: pulumi.Output; /** * A `sourceImageReference` block as defined below. Changing this forces a new resource to be created. * * > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set. */ readonly sourceImageReference: pulumi.Output; /** * A mapping of tags which should be assigned to this Virtual Machine. */ readonly tags: pulumi.Output<{ [key: string]: string; } | undefined>; /** * A `terminationNotification` block as defined below. */ readonly terminationNotification: pulumi.Output; /** * Specifies the Time Zone which should be used by the Virtual Machine, [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Changing this forces a new resource to be created. */ readonly timezone: pulumi.Output; /** * The Base64-Encoded User Data which should be used for this Virtual Machine. */ readonly userData: pulumi.Output; /** * A 128-bit identifier which uniquely identifies this Virtual Machine. */ readonly virtualMachineId: pulumi.Output; /** * Specifies the Orchestrated Virtual Machine Scale Set that this Virtual Machine should be created within. * * > **NOTE:** To update `virtualMachineScaleSetId` the Preview Feature `Microsoft.Compute/SingleFDAttachDetachVMToVmss` needs to be enabled, see [the documentation](https://review.learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm#enroll-in-the-preview) for more information. * * > **NOTE:** Orchestrated Virtual Machine Scale Sets can be provisioned using [the `azure.compute.OrchestratedVirtualMachineScaleSet` resource](https://www.terraform.io/docs/providers/azurerm/r/orchestrated_virtual_machine_scale_set.html). * * > **NOTE:** To attach an existing VM to a Virtual Machine Scale Set, the scale set must have `singlePlacementGroup` set to `false`, see [the documentation](https://learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3#limitations-for-attaching-an-existing-vm-to-a-scale-set) for more information. */ readonly virtualMachineScaleSetId: pulumi.Output; /** * Specifies whether VMAgent Platform Updates is enabled. Defaults to `false`. * * @deprecated this property has been deprecated due to a breaking change introduced by the Service team, which redefined it as a read-only field within the API */ readonly vmAgentPlatformUpdatesEnabled: pulumi.Output; /** * Specifies if vTPM (virtual Trusted Platform Module) and Trusted Launch is enabled for the Virtual Machine. Changing this forces a new resource to be created. */ readonly vtpmEnabled: pulumi.Output; /** * One or more `winrmListener` blocks as defined below. Changing this forces a new resource to be created. */ readonly winrmListeners: pulumi.Output; /** * * `zones` - (Optional) Specifies the Availability Zone in which this Windows Virtual Machine should be located. Changing this forces a new Windows Virtual Machine to be created. */ readonly zone: pulumi.Output; /** * Create a WindowsVirtualMachine resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: WindowsVirtualMachineArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering WindowsVirtualMachine resources. */ export interface WindowsVirtualMachineState { /** * A `additionalCapabilities` block as defined below. */ additionalCapabilities?: pulumi.Input; /** * One or more `additionalUnattendContent` blocks as defined below. Changing this forces a new resource to be created. */ additionalUnattendContents?: pulumi.Input[]>; /** * The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`. */ adminPassword?: pulumi.Input; /** * The username of the local administrator used for the Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`. */ adminUsername?: pulumi.Input; /** * Should Extension Operations be allowed on this Virtual Machine? Defaults to `true`. */ allowExtensionOperations?: pulumi.Input; /** * Specifies if Automatic Updates are Enabled for the Windows Virtual Machine. Changing this forces a new resource to be created. Defaults to `true`. */ automaticUpdatesEnabled?: pulumi.Input; /** * Specifies the ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created. */ availabilitySetId?: pulumi.Input; /** * A `bootDiagnostics` block as defined below. */ bootDiagnostics?: pulumi.Input; /** * Specifies whether to skip platform scheduled patching when a user schedule is associated with the VM. Defaults to `false`. * * > **NOTE:** `bypassPlatformSafetyChecksOnUserScheduleEnabled` can only be set to `true` when `patchMode` is set to `AutomaticByPlatform`. */ bypassPlatformSafetyChecksOnUserScheduleEnabled?: pulumi.Input; /** * Specifies the ID of the Capacity Reservation Group which the Virtual Machine should be allocated to. * * > **NOTE:** `capacityReservationGroupId` cannot be used with `availabilitySetId` or `proximityPlacementGroupId` */ capacityReservationGroupId?: pulumi.Input; /** * Specifies the Hostname which should be used for this Virtual Machine. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerName`, then you must specify `computerName`. Changing this forces a new resource to be created. */ computerName?: pulumi.Input; /** * The Base64-Encoded Custom Data which should be used for this Virtual Machine. Changing this forces a new resource to be created. */ customData?: pulumi.Input; /** * The ID of a Dedicated Host Group that this Windows Virtual Machine should be run within. Conflicts with `dedicatedHostId`. */ dedicatedHostGroupId?: pulumi.Input; /** * The ID of a Dedicated Host where this machine should be run on. Conflicts with `dedicatedHostGroupId`. */ dedicatedHostId?: pulumi.Input; /** * Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`. */ diskControllerType?: pulumi.Input; /** * Specifies the Edge Zone within the Azure Region where this Windows Virtual Machine should exist. Changing this forces a new Windows Virtual Machine to be created. */ edgeZone?: pulumi.Input; /** * @deprecated this property has been deprecated in favour of automaticUpdatesEnabled and will be removed in 5.0 of the provider. */ enableAutomaticUpdates?: pulumi.Input; /** * Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? */ encryptionAtHostEnabled?: pulumi.Input; /** * Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. * * > **NOTE:** This can only be configured when `priority` is set to `Spot`. */ evictionPolicy?: pulumi.Input; /** * Specifies the duration allocated 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. Defaults to `PT1H30M`. */ extensionsTimeBudget?: pulumi.Input; /** * One or more `galleryApplication` blocks as defined below. * * > **Note** Gallery Application Assignments can be defined either directly on `azure.compute.WindowsVirtualMachine` resource, or using the `azure.compute.GalleryApplicationAssignment` resource - but the two approaches cannot be used together. If both are used with the same Virtual Machine, spurious changes will occur. If `azure.compute.GalleryApplicationAssignment` is used, it's recommended to use `ignoreChanges` for the `galleryApplication` block on the corresponding `azure.compute.WindowsVirtualMachine` resource, to avoid a persistent diff when using this resource. */ galleryApplications?: pulumi.Input[]>; /** * Should the VM be patched without requiring a reboot? Possible values are `true` or `false`. Defaults to `false`. For more information about hot patching please see the [product documentation](https://docs.microsoft.com/azure/automanage/automanage-hotpatch). * * > **NOTE:** Hotpatching can only be enabled if the `patchMode` is set to `AutomaticByPlatform`, the `provisionVmAgent` is set to `true`, your `sourceImageReference` references a hotpatching enabled image, and the VM's `size` is set to a [Azure generation 2](https://docs.microsoft.com/azure/virtual-machines/generation-2#generation-2-vm-sizes) VM. An example of how to correctly configure a Windows Virtual Machine to use the `hotpatchingEnabled` field can be found in the `./examples/virtual-machines/windows/hotpatching-enabled` directory within the GitHub Repository. */ hotpatchingEnabled?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * Specifies the type of on-premise license (also known as [Azure Hybrid Use Benefit](https://docs.microsoft.com/windows-server/get-started/azure-hybrid-benefit)) which should be used for this Virtual Machine. Possible values are `None`, `Windows_Client` and `Windows_Server`. */ licenseType?: pulumi.Input; /** * The Azure location where the Windows Virtual Machine should exist. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * The maximum price you're willing to pay for this Virtual Machine, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machine will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that the Virtual Machine should not be evicted for price reasons. * * > **NOTE:** This can only be configured when `priority` is set to `Spot`. */ maxBidPrice?: pulumi.Input; /** * The name of the Windows Virtual Machine. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * . A list of Network Interface IDs which should be attached to this Virtual Machine. The first Network Interface ID in this list will be the Primary Network Interface on the Virtual Machine. */ networkInterfaceIds?: pulumi.Input[]>; /** * An `osDisk` block as defined below. */ osDisk?: pulumi.Input; /** * A `osImageNotification` block as defined below. */ osImageNotification?: pulumi.Input; /** * The ID of an existing Managed Disk to use as the OS Disk for this Windows Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** When specifying an existing Managed Disk it is not currently possible to subsequently manage the Operating System Profile properties: `adminUsername`, `adminPassword`, `bypassPlatformSafetyChecksOnUserScheduleEnabled`, `computerName`, `customData`, `provisionVmAgent`, `patchMode`, `patchAssessmentMode`, or `rebootSetting`. */ osManagedDiskId?: pulumi.Input; /** * Specifies the mode of VM Guest Patching for the Virtual Machine. Possible values are `AutomaticByPlatform` or `ImageDefault`. Defaults to `ImageDefault`. * * > **NOTE:** If the `patchAssessmentMode` is set to `AutomaticByPlatform` then the `provisionVmAgent` field must be set to `true`. */ patchAssessmentMode?: pulumi.Input; /** * Specifies the mode of in-guest patching to this Windows Virtual Machine. Possible values are `Manual`, `AutomaticByOS` and `AutomaticByPlatform`. Defaults to `AutomaticByOS`. For more information on patch modes please see the [product documentation](https://docs.microsoft.com/azure/virtual-machines/automatic-vm-guest-patching#patch-orchestration-modes). * * > **NOTE:** If `patchMode` is set to `AutomaticByPlatform` then `provisionVmAgent` must also be set to `true`. If the Virtual Machine is using a hotpatching enabled image the `patchMode` must always be set to `AutomaticByPlatform`. */ patchMode?: pulumi.Input; /** * A `plan` block as defined below. Changing this forces a new resource to be created. */ plan?: pulumi.Input; /** * Specifies the Platform Fault Domain in which this Windows Virtual Machine should be created. Defaults to `-1`, which means this will be automatically assigned to a fault domain that best maintains balance across the available fault domains. Changing this forces a new Windows Virtual Machine to be created. */ platformFaultDomain?: pulumi.Input; /** * Specifies the priority of this Virtual Machine. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this forces a new resource to be created. */ priority?: pulumi.Input; /** * The Primary Private IP Address assigned to this Virtual Machine. */ privateIpAddress?: pulumi.Input; /** * A list of Private IP Addresses assigned to this Virtual Machine. */ privateIpAddresses?: pulumi.Input[]>; /** * Should the Azure VM Agent be provisioned on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created. * * > **NOTE:** If `provisionVmAgent` is set to `false` then `allowExtensionOperations` must also be set to `false`. */ provisionVmAgent?: pulumi.Input; /** * The ID of the Proximity Placement Group which the Virtual Machine should be assigned to. */ proximityPlacementGroupId?: pulumi.Input; /** * The Primary Public IP Address assigned to this Virtual Machine. */ publicIpAddress?: pulumi.Input; /** * A list of the Public IP Addresses assigned to this Virtual Machine. */ publicIpAddresses?: pulumi.Input[]>; /** * Specifies the reboot setting for platform scheduled patching. Possible values are `Always`, `IfRequired` and `Never`. * * > **NOTE:** `rebootSetting` can only be set when `patchMode` is set to `AutomaticByPlatform`. */ rebootSetting?: pulumi.Input; /** * The name of the Resource Group in which the Windows Virtual Machine should be exist. Changing this forces a new resource to be created. */ resourceGroupName?: pulumi.Input; /** * One or more `secret` blocks as defined below. */ secrets?: pulumi.Input[]>; /** * Specifies if Secure Boot and Trusted Launch is enabled for the Virtual Machine. Changing this forces a new resource to be created. */ secureBootEnabled?: pulumi.Input; /** * The SKU which should be used for this Virtual Machine, such as `Standard_F2`. */ size?: pulumi.Input; /** * The ID of the Image which this Virtual Machine should be created from. Changing this forces a new resource to be created. Possible Image ID types include `Image ID`s, `Shared Image ID`s, `Shared Image Version ID`s, `Community Gallery Image ID`s, `Community Gallery Image Version ID`s, `Shared Gallery Image ID`s and `Shared Gallery Image Version ID`s. * * > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set. */ sourceImageId?: pulumi.Input; /** * A `sourceImageReference` block as defined below. Changing this forces a new resource to be created. * * > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set. */ sourceImageReference?: pulumi.Input; /** * A mapping of tags which should be assigned to this Virtual Machine. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A `terminationNotification` block as defined below. */ terminationNotification?: pulumi.Input; /** * Specifies the Time Zone which should be used by the Virtual Machine, [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Changing this forces a new resource to be created. */ timezone?: pulumi.Input; /** * The Base64-Encoded User Data which should be used for this Virtual Machine. */ userData?: pulumi.Input; /** * A 128-bit identifier which uniquely identifies this Virtual Machine. */ virtualMachineId?: pulumi.Input; /** * Specifies the Orchestrated Virtual Machine Scale Set that this Virtual Machine should be created within. * * > **NOTE:** To update `virtualMachineScaleSetId` the Preview Feature `Microsoft.Compute/SingleFDAttachDetachVMToVmss` needs to be enabled, see [the documentation](https://review.learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm#enroll-in-the-preview) for more information. * * > **NOTE:** Orchestrated Virtual Machine Scale Sets can be provisioned using [the `azure.compute.OrchestratedVirtualMachineScaleSet` resource](https://www.terraform.io/docs/providers/azurerm/r/orchestrated_virtual_machine_scale_set.html). * * > **NOTE:** To attach an existing VM to a Virtual Machine Scale Set, the scale set must have `singlePlacementGroup` set to `false`, see [the documentation](https://learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3#limitations-for-attaching-an-existing-vm-to-a-scale-set) for more information. */ virtualMachineScaleSetId?: pulumi.Input; /** * Specifies whether VMAgent Platform Updates is enabled. Defaults to `false`. * * @deprecated this property has been deprecated due to a breaking change introduced by the Service team, which redefined it as a read-only field within the API */ vmAgentPlatformUpdatesEnabled?: pulumi.Input; /** * Specifies if vTPM (virtual Trusted Platform Module) and Trusted Launch is enabled for the Virtual Machine. Changing this forces a new resource to be created. */ vtpmEnabled?: pulumi.Input; /** * One or more `winrmListener` blocks as defined below. Changing this forces a new resource to be created. */ winrmListeners?: pulumi.Input[]>; /** * * `zones` - (Optional) Specifies the Availability Zone in which this Windows Virtual Machine should be located. Changing this forces a new Windows Virtual Machine to be created. */ zone?: pulumi.Input; } /** * The set of arguments for constructing a WindowsVirtualMachine resource. */ export interface WindowsVirtualMachineArgs { /** * A `additionalCapabilities` block as defined below. */ additionalCapabilities?: pulumi.Input; /** * One or more `additionalUnattendContent` blocks as defined below. Changing this forces a new resource to be created. */ additionalUnattendContents?: pulumi.Input[]>; /** * The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`. */ adminPassword?: pulumi.Input; /** * The username of the local administrator used for the Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** This is required unless using an existing OS Managed Disk by specifying `osManagedDiskId`. */ adminUsername?: pulumi.Input; /** * Should Extension Operations be allowed on this Virtual Machine? Defaults to `true`. */ allowExtensionOperations?: pulumi.Input; /** * Specifies if Automatic Updates are Enabled for the Windows Virtual Machine. Changing this forces a new resource to be created. Defaults to `true`. */ automaticUpdatesEnabled?: pulumi.Input; /** * Specifies the ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created. */ availabilitySetId?: pulumi.Input; /** * A `bootDiagnostics` block as defined below. */ bootDiagnostics?: pulumi.Input; /** * Specifies whether to skip platform scheduled patching when a user schedule is associated with the VM. Defaults to `false`. * * > **NOTE:** `bypassPlatformSafetyChecksOnUserScheduleEnabled` can only be set to `true` when `patchMode` is set to `AutomaticByPlatform`. */ bypassPlatformSafetyChecksOnUserScheduleEnabled?: pulumi.Input; /** * Specifies the ID of the Capacity Reservation Group which the Virtual Machine should be allocated to. * * > **NOTE:** `capacityReservationGroupId` cannot be used with `availabilitySetId` or `proximityPlacementGroupId` */ capacityReservationGroupId?: pulumi.Input; /** * Specifies the Hostname which should be used for this Virtual Machine. If unspecified this defaults to the value for the `name` field. If the value of the `name` field is not a valid `computerName`, then you must specify `computerName`. Changing this forces a new resource to be created. */ computerName?: pulumi.Input; /** * The Base64-Encoded Custom Data which should be used for this Virtual Machine. Changing this forces a new resource to be created. */ customData?: pulumi.Input; /** * The ID of a Dedicated Host Group that this Windows Virtual Machine should be run within. Conflicts with `dedicatedHostId`. */ dedicatedHostGroupId?: pulumi.Input; /** * The ID of a Dedicated Host where this machine should be run on. Conflicts with `dedicatedHostGroupId`. */ dedicatedHostId?: pulumi.Input; /** * Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`. */ diskControllerType?: pulumi.Input; /** * Specifies the Edge Zone within the Azure Region where this Windows Virtual Machine should exist. Changing this forces a new Windows Virtual Machine to be created. */ edgeZone?: pulumi.Input; /** * @deprecated this property has been deprecated in favour of automaticUpdatesEnabled and will be removed in 5.0 of the provider. */ enableAutomaticUpdates?: pulumi.Input; /** * Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? */ encryptionAtHostEnabled?: pulumi.Input; /** * Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. * * > **NOTE:** This can only be configured when `priority` is set to `Spot`. */ evictionPolicy?: pulumi.Input; /** * Specifies the duration allocated 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. Defaults to `PT1H30M`. */ extensionsTimeBudget?: pulumi.Input; /** * One or more `galleryApplication` blocks as defined below. * * > **Note** Gallery Application Assignments can be defined either directly on `azure.compute.WindowsVirtualMachine` resource, or using the `azure.compute.GalleryApplicationAssignment` resource - but the two approaches cannot be used together. If both are used with the same Virtual Machine, spurious changes will occur. If `azure.compute.GalleryApplicationAssignment` is used, it's recommended to use `ignoreChanges` for the `galleryApplication` block on the corresponding `azure.compute.WindowsVirtualMachine` resource, to avoid a persistent diff when using this resource. */ galleryApplications?: pulumi.Input[]>; /** * Should the VM be patched without requiring a reboot? Possible values are `true` or `false`. Defaults to `false`. For more information about hot patching please see the [product documentation](https://docs.microsoft.com/azure/automanage/automanage-hotpatch). * * > **NOTE:** Hotpatching can only be enabled if the `patchMode` is set to `AutomaticByPlatform`, the `provisionVmAgent` is set to `true`, your `sourceImageReference` references a hotpatching enabled image, and the VM's `size` is set to a [Azure generation 2](https://docs.microsoft.com/azure/virtual-machines/generation-2#generation-2-vm-sizes) VM. An example of how to correctly configure a Windows Virtual Machine to use the `hotpatchingEnabled` field can be found in the `./examples/virtual-machines/windows/hotpatching-enabled` directory within the GitHub Repository. */ hotpatchingEnabled?: pulumi.Input; /** * An `identity` block as defined below. */ identity?: pulumi.Input; /** * Specifies the type of on-premise license (also known as [Azure Hybrid Use Benefit](https://docs.microsoft.com/windows-server/get-started/azure-hybrid-benefit)) which should be used for this Virtual Machine. Possible values are `None`, `Windows_Client` and `Windows_Server`. */ licenseType?: pulumi.Input; /** * The Azure location where the Windows Virtual Machine should exist. Changing this forces a new resource to be created. */ location?: pulumi.Input; /** * The maximum price you're willing to pay for this Virtual Machine, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machine will be evicted using the `evictionPolicy`. Defaults to `-1`, which means that the Virtual Machine should not be evicted for price reasons. * * > **NOTE:** This can only be configured when `priority` is set to `Spot`. */ maxBidPrice?: pulumi.Input; /** * The name of the Windows Virtual Machine. Changing this forces a new resource to be created. */ name?: pulumi.Input; /** * . A list of Network Interface IDs which should be attached to this Virtual Machine. The first Network Interface ID in this list will be the Primary Network Interface on the Virtual Machine. */ networkInterfaceIds: pulumi.Input[]>; /** * An `osDisk` block as defined below. */ osDisk: pulumi.Input; /** * A `osImageNotification` block as defined below. */ osImageNotification?: pulumi.Input; /** * The ID of an existing Managed Disk to use as the OS Disk for this Windows Virtual Machine. Changing this forces a new resource to be created. * * > **Note:** When specifying an existing Managed Disk it is not currently possible to subsequently manage the Operating System Profile properties: `adminUsername`, `adminPassword`, `bypassPlatformSafetyChecksOnUserScheduleEnabled`, `computerName`, `customData`, `provisionVmAgent`, `patchMode`, `patchAssessmentMode`, or `rebootSetting`. */ osManagedDiskId?: pulumi.Input; /** * Specifies the mode of VM Guest Patching for the Virtual Machine. Possible values are `AutomaticByPlatform` or `ImageDefault`. Defaults to `ImageDefault`. * * > **NOTE:** If the `patchAssessmentMode` is set to `AutomaticByPlatform` then the `provisionVmAgent` field must be set to `true`. */ patchAssessmentMode?: pulumi.Input; /** * Specifies the mode of in-guest patching to this Windows Virtual Machine. Possible values are `Manual`, `AutomaticByOS` and `AutomaticByPlatform`. Defaults to `AutomaticByOS`. For more information on patch modes please see the [product documentation](https://docs.microsoft.com/azure/virtual-machines/automatic-vm-guest-patching#patch-orchestration-modes). * * > **NOTE:** If `patchMode` is set to `AutomaticByPlatform` then `provisionVmAgent` must also be set to `true`. If the Virtual Machine is using a hotpatching enabled image the `patchMode` must always be set to `AutomaticByPlatform`. */ patchMode?: pulumi.Input; /** * A `plan` block as defined below. Changing this forces a new resource to be created. */ plan?: pulumi.Input; /** * Specifies the Platform Fault Domain in which this Windows Virtual Machine should be created. Defaults to `-1`, which means this will be automatically assigned to a fault domain that best maintains balance across the available fault domains. Changing this forces a new Windows Virtual Machine to be created. */ platformFaultDomain?: pulumi.Input; /** * Specifies the priority of this Virtual Machine. Possible values are `Regular` and `Spot`. Defaults to `Regular`. Changing this forces a new resource to be created. */ priority?: pulumi.Input; /** * Should the Azure VM Agent be provisioned on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created. * * > **NOTE:** If `provisionVmAgent` is set to `false` then `allowExtensionOperations` must also be set to `false`. */ provisionVmAgent?: pulumi.Input; /** * The ID of the Proximity Placement Group which the Virtual Machine should be assigned to. */ proximityPlacementGroupId?: pulumi.Input; /** * Specifies the reboot setting for platform scheduled patching. Possible values are `Always`, `IfRequired` and `Never`. * * > **NOTE:** `rebootSetting` can only be set when `patchMode` is set to `AutomaticByPlatform`. */ rebootSetting?: pulumi.Input; /** * The name of the Resource Group in which the Windows Virtual Machine should be exist. Changing this forces a new resource to be created. */ resourceGroupName: pulumi.Input; /** * One or more `secret` blocks as defined below. */ secrets?: pulumi.Input[]>; /** * Specifies if Secure Boot and Trusted Launch is enabled for the Virtual Machine. Changing this forces a new resource to be created. */ secureBootEnabled?: pulumi.Input; /** * The SKU which should be used for this Virtual Machine, such as `Standard_F2`. */ size: pulumi.Input; /** * The ID of the Image which this Virtual Machine should be created from. Changing this forces a new resource to be created. Possible Image ID types include `Image ID`s, `Shared Image ID`s, `Shared Image Version ID`s, `Community Gallery Image ID`s, `Community Gallery Image Version ID`s, `Shared Gallery Image ID`s and `Shared Gallery Image Version ID`s. * * > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set. */ sourceImageId?: pulumi.Input; /** * A `sourceImageReference` block as defined below. Changing this forces a new resource to be created. * * > **NOTE:** One of either `sourceImageId` or `sourceImageReference` must be set. */ sourceImageReference?: pulumi.Input; /** * A mapping of tags which should be assigned to this Virtual Machine. */ tags?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A `terminationNotification` block as defined below. */ terminationNotification?: pulumi.Input; /** * Specifies the Time Zone which should be used by the Virtual Machine, [the possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/). Changing this forces a new resource to be created. */ timezone?: pulumi.Input; /** * The Base64-Encoded User Data which should be used for this Virtual Machine. */ userData?: pulumi.Input; /** * Specifies the Orchestrated Virtual Machine Scale Set that this Virtual Machine should be created within. * * > **NOTE:** To update `virtualMachineScaleSetId` the Preview Feature `Microsoft.Compute/SingleFDAttachDetachVMToVmss` needs to be enabled, see [the documentation](https://review.learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm#enroll-in-the-preview) for more information. * * > **NOTE:** Orchestrated Virtual Machine Scale Sets can be provisioned using [the `azure.compute.OrchestratedVirtualMachineScaleSet` resource](https://www.terraform.io/docs/providers/azurerm/r/orchestrated_virtual_machine_scale_set.html). * * > **NOTE:** To attach an existing VM to a Virtual Machine Scale Set, the scale set must have `singlePlacementGroup` set to `false`, see [the documentation](https://learn.microsoft.com/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-attach-detach-vm?tabs=portal-1%2Cportal-2%2Cportal-3#limitations-for-attaching-an-existing-vm-to-a-scale-set) for more information. */ virtualMachineScaleSetId?: pulumi.Input; /** * Specifies whether VMAgent Platform Updates is enabled. Defaults to `false`. * * @deprecated this property has been deprecated due to a breaking change introduced by the Service team, which redefined it as a read-only field within the API */ vmAgentPlatformUpdatesEnabled?: pulumi.Input; /** * Specifies if vTPM (virtual Trusted Platform Module) and Trusted Launch is enabled for the Virtual Machine. Changing this forces a new resource to be created. */ vtpmEnabled?: pulumi.Input; /** * One or more `winrmListener` blocks as defined below. Changing this forces a new resource to be created. */ winrmListeners?: pulumi.Input[]>; /** * * `zones` - (Optional) Specifies the Availability Zone in which this Windows Virtual Machine should be located. Changing this forces a new Windows Virtual Machine to be created. */ zone?: pulumi.Input; }