@pulumi/azure-native
Version:
[](https://slack.pulumi.com) [](https://npmjs.com/package/@pulumi/azure-native) [ • 21.7 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
import * as enums from "../types/enums";
/**
* Describes a Virtual Machine.
*
* Uses Azure REST API version 2024-11-01. In version 2.x of the Azure Native provider, it used API version 2023-03-01.
*
* Other available API versions: 2022-08-01, 2022-11-01, 2023-03-01, 2023-07-01, 2023-09-01, 2024-03-01, 2024-07-01. These can be accessed by generating a local SDK package using the CLI command `pulumi package add azure-native compute [ApiVersion]`. See the [version guide](../../../version-guide/#accessing-any-api-version-via-local-packages) for details.
*/
export declare class VirtualMachine extends pulumi.CustomResource {
/**
* Get an existing VirtualMachine 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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name: string, id: pulumi.Input<pulumi.ID>, opts?: pulumi.CustomResourceOptions): VirtualMachine;
/**
* Returns true if the given object is an instance of VirtualMachine. 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 VirtualMachine;
/**
* Specifies additional capabilities enabled or disabled on the virtual machine.
*/
readonly additionalCapabilities: pulumi.Output<outputs.compute.AdditionalCapabilitiesResponse | undefined>;
/**
* Specifies the gallery applications that should be made available to the VM/VMSS.
*/
readonly applicationProfile: pulumi.Output<outputs.compute.ApplicationProfileResponse | undefined>;
/**
* 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.
*/
readonly availabilitySet: pulumi.Output<outputs.compute.SubResourceResponse | undefined>;
/**
* The Azure API version of the resource.
*/
readonly azureApiVersion: pulumi.Output<string>;
/**
* Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01.
*/
readonly billingProfile: pulumi.Output<outputs.compute.BillingProfileResponse | undefined>;
/**
* Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01.
*/
readonly capacityReservation: pulumi.Output<outputs.compute.CapacityReservationProfileResponse | undefined>;
/**
* Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
*/
readonly diagnosticsProfile: pulumi.Output<outputs.compute.DiagnosticsProfileResponse | undefined>;
/**
* Etag is property returned in Create/Update/Get response of the VM, so that customer can supply it in the header to ensure optimistic updates.
*/
readonly etag: pulumi.Output<string>;
/**
* 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.
*/
readonly evictionPolicy: pulumi.Output<string | undefined>;
/**
* The extended location of the Virtual Machine.
*/
readonly extendedLocation: pulumi.Output<outputs.compute.ExtendedLocationResponse | undefined>;
/**
* 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.
*/
readonly extensionsTimeBudget: pulumi.Output<string | undefined>;
/**
* Specifies the hardware settings for the virtual machine.
*/
readonly hardwareProfile: pulumi.Output<outputs.compute.HardwareProfileResponse | undefined>;
/**
* Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01.
*/
readonly host: pulumi.Output<outputs.compute.SubResourceResponse | undefined>;
/**
* 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.
*/
readonly hostGroup: pulumi.Output<outputs.compute.SubResourceResponse | undefined>;
/**
* The identity of the virtual machine, if configured.
*/
readonly identity: pulumi.Output<outputs.compute.VirtualMachineIdentityResponse | undefined>;
/**
* The virtual machine instance view.
*/
readonly instanceView: pulumi.Output<outputs.compute.VirtualMachineInstanceViewResponse>;
/**
* 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
*/
readonly licenseType: pulumi.Output<string | undefined>;
/**
* The geo-location where the resource lives
*/
readonly location: pulumi.Output<string>;
/**
* ManagedBy is set to Virtual Machine Scale Set(VMSS) flex ARM resourceID, if the VM is part of the VMSS. This property is used by platform for internal resource group delete optimization.
*/
readonly managedBy: pulumi.Output<string>;
/**
* The name of the resource
*/
readonly name: pulumi.Output<string>;
/**
* Specifies the network interfaces of the virtual machine.
*/
readonly networkProfile: pulumi.Output<outputs.compute.NetworkProfileResponse | undefined>;
/**
* Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.
*/
readonly osProfile: pulumi.Output<outputs.compute.OSProfileResponse | undefined>;
/**
* Placement section specifies the user-defined constraints for virtual machine hardware placement. This property cannot be changed once VM is provisioned. Minimum api-version: 2024-11-01.
*/
readonly placement: pulumi.Output<outputs.compute.PlacementResponse | undefined>;
/**
* 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**.
*/
readonly plan: pulumi.Output<outputs.compute.PlanResponse | undefined>;
/**
* 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.
*/
readonly platformFaultDomain: pulumi.Output<number | undefined>;
/**
* Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01
*/
readonly priority: pulumi.Output<string | undefined>;
/**
* The provisioning state, which only appears in the response.
*/
readonly provisioningState: pulumi.Output<string>;
/**
* Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01.
*/
readonly proximityPlacementGroup: pulumi.Output<outputs.compute.SubResourceResponse | undefined>;
/**
* The virtual machine child extension resources.
*/
readonly resources: pulumi.Output<outputs.compute.VirtualMachineExtensionResponse[]>;
/**
* Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the virtual machine.
*/
readonly scheduledEventsPolicy: pulumi.Output<outputs.compute.ScheduledEventsPolicyResponse | undefined>;
/**
* Specifies Scheduled Event related configurations.
*/
readonly scheduledEventsProfile: pulumi.Output<outputs.compute.ScheduledEventsProfileResponse | undefined>;
/**
* Specifies the Security related profile settings for the virtual machine.
*/
readonly securityProfile: pulumi.Output<outputs.compute.SecurityProfileResponse | undefined>;
/**
* Specifies the storage settings for the virtual machine disks.
*/
readonly storageProfile: pulumi.Output<outputs.compute.StorageProfileResponse | undefined>;
/**
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
readonly systemData: pulumi.Output<outputs.compute.SystemDataResponse>;
/**
* Resource tags.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* Specifies the time at which the Virtual Machine resource was created. Minimum api-version: 2021-11-01.
*/
readonly timeCreated: pulumi.Output<string>;
/**
* The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
*/
readonly type: pulumi.Output<string>;
/**
* UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.
*/
readonly userData: pulumi.Output<string | undefined>;
/**
* 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.
*/
readonly virtualMachineScaleSet: pulumi.Output<outputs.compute.SubResourceResponse | undefined>;
/**
* 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.
*/
readonly vmId: pulumi.Output<string>;
/**
* The availability zones.
*/
readonly zones: pulumi.Output<string[] | undefined>;
/**
* Create a VirtualMachine 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: VirtualMachineArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* The set of arguments for constructing a VirtualMachine resource.
*/
export interface VirtualMachineArgs {
/**
* Specifies additional capabilities enabled or disabled on the virtual machine.
*/
additionalCapabilities?: pulumi.Input<inputs.compute.AdditionalCapabilitiesArgs>;
/**
* Specifies the gallery applications that should be made available to the VM/VMSS.
*/
applicationProfile?: pulumi.Input<inputs.compute.ApplicationProfileArgs>;
/**
* 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.
*/
availabilitySet?: pulumi.Input<inputs.compute.SubResourceArgs>;
/**
* Specifies the billing related details of a Azure Spot virtual machine. Minimum api-version: 2019-03-01.
*/
billingProfile?: pulumi.Input<inputs.compute.BillingProfileArgs>;
/**
* Specifies information about the capacity reservation that is used to allocate virtual machine. Minimum api-version: 2021-04-01.
*/
capacityReservation?: pulumi.Input<inputs.compute.CapacityReservationProfileArgs>;
/**
* Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15.
*/
diagnosticsProfile?: pulumi.Input<inputs.compute.DiagnosticsProfileArgs>;
/**
* 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.
*/
evictionPolicy?: pulumi.Input<string | enums.compute.VirtualMachineEvictionPolicyTypes>;
/**
* The extended location of the Virtual Machine.
*/
extendedLocation?: pulumi.Input<inputs.compute.ExtendedLocationArgs>;
/**
* 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.
*/
extensionsTimeBudget?: pulumi.Input<string>;
/**
* Specifies the hardware settings for the virtual machine.
*/
hardwareProfile?: pulumi.Input<inputs.compute.HardwareProfileArgs>;
/**
* Specifies information about the dedicated host that the virtual machine resides in. Minimum api-version: 2018-10-01.
*/
host?: pulumi.Input<inputs.compute.SubResourceArgs>;
/**
* 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.
*/
hostGroup?: pulumi.Input<inputs.compute.SubResourceArgs>;
/**
* The identity of the virtual machine, if configured.
*/
identity?: pulumi.Input<inputs.compute.VirtualMachineIdentityArgs>;
/**
* 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
*/
licenseType?: pulumi.Input<string>;
/**
* The geo-location where the resource lives
*/
location?: pulumi.Input<string>;
/**
* Specifies the network interfaces of the virtual machine.
*/
networkProfile?: pulumi.Input<inputs.compute.NetworkProfileArgs>;
/**
* Specifies the operating system settings used while creating the virtual machine. Some of the settings cannot be changed once VM is provisioned.
*/
osProfile?: pulumi.Input<inputs.compute.OSProfileArgs>;
/**
* Placement section specifies the user-defined constraints for virtual machine hardware placement. This property cannot be changed once VM is provisioned. Minimum api-version: 2024-11-01.
*/
placement?: pulumi.Input<inputs.compute.PlacementArgs>;
/**
* 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**.
*/
plan?: pulumi.Input<inputs.compute.PlanArgs>;
/**
* 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.
*/
platformFaultDomain?: pulumi.Input<number>;
/**
* Specifies the priority for the virtual machine. Minimum api-version: 2019-03-01
*/
priority?: pulumi.Input<string | enums.compute.VirtualMachinePriorityTypes>;
/**
* Specifies information about the proximity placement group that the virtual machine should be assigned to. Minimum api-version: 2018-04-01.
*/
proximityPlacementGroup?: pulumi.Input<inputs.compute.SubResourceArgs>;
/**
* The name of the resource group. The name is case insensitive.
*/
resourceGroupName: pulumi.Input<string>;
/**
* Specifies Redeploy, Reboot and ScheduledEventsAdditionalPublishingTargets Scheduled Event related configurations for the virtual machine.
*/
scheduledEventsPolicy?: pulumi.Input<inputs.compute.ScheduledEventsPolicyArgs>;
/**
* Specifies Scheduled Event related configurations.
*/
scheduledEventsProfile?: pulumi.Input<inputs.compute.ScheduledEventsProfileArgs>;
/**
* Specifies the Security related profile settings for the virtual machine.
*/
securityProfile?: pulumi.Input<inputs.compute.SecurityProfileArgs>;
/**
* Specifies the storage settings for the virtual machine disks.
*/
storageProfile?: pulumi.Input<inputs.compute.StorageProfileArgs>;
/**
* Resource tags.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* UserData for the VM, which must be base-64 encoded. Customer should not pass any secrets in here. Minimum api-version: 2021-03-01.
*/
userData?: pulumi.Input<string>;
/**
* 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.
*/
virtualMachineScaleSet?: pulumi.Input<inputs.compute.SubResourceArgs>;
/**
* The name of the virtual machine.
*/
vmName?: pulumi.Input<string>;
/**
* The availability zones.
*/
zones?: pulumi.Input<pulumi.Input<string>[]>;
}