Class WindowsVirtualMachine
Manages a Windows Virtual Machine.
Disclaimers
Note This provider will automatically remove the OS Disk by default - this behaviour can be configured using the
featuresconfiguration within the Provider configuration block.
Note This resource does not support Unmanaged Disks. If you need to use Unmanaged Disks you can continue to use the
azure.compute.VirtualMachineresource 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.VirtualMachineresource instead.
In this release there's a known issue where the
public_ip_addressandpublic_ip_addressesfields may not be fully populated for Dynamic Public IP's.
Inherited Members
Namespace: Pulumi.Azure.Compute
Assembly: Pulumi.Azure.dll
Syntax
public class WindowsVirtualMachine : CustomResource
Constructors
View SourceWindowsVirtualMachine(String, WindowsVirtualMachineArgs, CustomResourceOptions)
Create a WindowsVirtualMachine resource with the given unique name, arguments, and options.
Declaration
public WindowsVirtualMachine(string name, WindowsVirtualMachineArgs args, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resource |
| WindowsVirtualMachineArgs | args | The arguments used to populate this resource's properties |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Properties
View SourceAdditionalCapabilities
A additional_capabilities block as defined below.
Declaration
public Output<WindowsVirtualMachineAdditionalCapabilities> AdditionalCapabilities { get; }
Property Value
| Type | Description |
|---|---|
| Output<WindowsVirtualMachineAdditionalCapabilities> |
AdditionalUnattendContents
One or more additional_unattend_content blocks as defined below. Changing this forces a new resource to be created.
Declaration
public Output<ImmutableArray<WindowsVirtualMachineAdditionalUnattendContent>> AdditionalUnattendContents { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<WindowsVirtualMachineAdditionalUnattendContent>> |
AdminPassword
The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.
Declaration
public Output<string> AdminPassword { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AdminUsername
The username of the local administrator used for the Virtual Machine. Changing this forces a new resource to be created.
Declaration
public Output<string> AdminUsername { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
AllowExtensionOperations
Should Extension Operations be allowed on this Virtual Machine? Changing this forces a new resource to be created.
Declaration
public Output<bool?> AllowExtensionOperations { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
AvailabilitySetId
Specifies the ID of the Availability Set in which the Virtual Machine should exist. Changing this forces a new resource to be created.
Declaration
public Output<string> AvailabilitySetId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
BootDiagnostics
A boot_diagnostics block as defined below.
Declaration
public Output<WindowsVirtualMachineBootDiagnostics> BootDiagnostics { get; }
Property Value
| Type | Description |
|---|---|
| Output<WindowsVirtualMachineBootDiagnostics> |
ComputerName
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 computer_name, then you must specify computer_name. Changing this forces a new resource to be created.
Declaration
public Output<string> ComputerName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
CustomData
The Base64-Encoded Custom Data which should be used for this Virtual Machine. Changing this forces a new resource to be created.
Declaration
public Output<string> CustomData { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
DedicatedHostId
The ID of a Dedicated Host where this machine should be run on. Changing this forces a new resource to be created.
Declaration
public Output<string> DedicatedHostId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
EnableAutomaticUpdates
Specifies if Automatic Updates are Enabled for the Windows Virtual Machine. Changing this forces a new resource to be created.
Declaration
public Output<bool?> EnableAutomaticUpdates { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
EvictionPolicy
Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. At this time the only supported value is Deallocate. Changing this forces a new resource to be created.
Declaration
public Output<string> EvictionPolicy { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Identity
An identity block as defined below.
Declaration
public Output<WindowsVirtualMachineIdentity> Identity { get; }
Property Value
| Type | Description |
|---|---|
| Output<WindowsVirtualMachineIdentity> |
LicenseType
Specifies the type of on-premise license (also known as Azure Hybrid Use Benefit) which should be used for this Virtual Machine. Possible values are None, Windows_Client and Windows_Server. Changing this forces a new resource to be created.
Declaration
public Output<string> LicenseType { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Location
The Azure location where the Windows Virtual Machine should exist. Changing this forces a new resource to be created.
Declaration
public Output<string> Location { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
MaxBidPrice
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 eviction_policy. Defaults to -1, which means that the Virtual Machine should not be evicted for price reasons.
Declaration
public Output<double?> MaxBidPrice { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Double>> |
Name
The name of the Windows Virtual Machine. Changing this forces a new resource to be created.
Declaration
public Output<string> Name { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
NetworkInterfaceIds
. A list of Network Interface ID's 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.
Declaration
public Output<ImmutableArray<string>> NetworkInterfaceIds { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
OsDisk
A os_disk block as defined below.
Declaration
public Output<WindowsVirtualMachineOsDisk> OsDisk { get; }
Property Value
| Type | Description |
|---|---|
| Output<WindowsVirtualMachineOsDisk> |
Plan
A plan block as defined below. Changing this forces a new resource to be created.
Declaration
public Output<WindowsVirtualMachinePlan> Plan { get; }
Property Value
| Type | Description |
|---|---|
| Output<WindowsVirtualMachinePlan> |
Priority
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.
Declaration
public Output<string> Priority { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PrivateIpAddress
The Primary Private IP Address assigned to this Virtual Machine.
Declaration
public Output<string> PrivateIpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PrivateIpAddresses
A list of Private IP Addresses assigned to this Virtual Machine.
Declaration
public Output<ImmutableArray<string>> PrivateIpAddresses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ProvisionVmAgent
Should the Azure VM Agent be provisioned on this Virtual Machine? Defaults to true. Changing this forces a new resource to be created.
Declaration
public Output<bool?> ProvisionVmAgent { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Nullable<System.Boolean>> |
ProximityPlacementGroupId
The ID of the Proximity Placement Group which the Virtual Machine should be assigned to. Changing this forces a new resource to be created.
Declaration
public Output<string> ProximityPlacementGroupId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PublicIpAddress
The Primary Public IP Address assigned to this Virtual Machine.
Declaration
public Output<string> PublicIpAddress { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
PublicIpAddresses
A list of the Public IP Addresses assigned to this Virtual Machine.
Declaration
public Output<ImmutableArray<string>> PublicIpAddresses { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<System.String>> |
ResourceGroupName
The name of the Resource Group in which the Windows Virtual Machine should be exist. Changing this forces a new resource to be created.
Declaration
public Output<string> ResourceGroupName { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Secrets
One or more secret blocks as defined below.
Declaration
public Output<ImmutableArray<WindowsVirtualMachineSecret>> Secrets { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<WindowsVirtualMachineSecret>> |
Size
The SKU which should be used for this Virtual Machine, such as Standard_F2.
Declaration
public Output<string> Size { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceImageId
The ID of the Image which this Virtual Machine should be created from. Changing this forces a new resource to be created.
Declaration
public Output<string> SourceImageId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
SourceImageReference
A source_image_reference block as defined below. Changing this forces a new resource to be created.
Declaration
public Output<WindowsVirtualMachineSourceImageReference> SourceImageReference { get; }
Property Value
| Type | Description |
|---|---|
| Output<WindowsVirtualMachineSourceImageReference> |
Tags
A mapping of tags which should be assigned to this Virtual Machine.
Declaration
public Output<ImmutableDictionary<string, string>> Tags { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableDictionary<System.String, System.String>> |
Timezone
Specifies the Time Zone which should be used by the Virtual Machine, the possible values are defined here.
Declaration
public Output<string> Timezone { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VirtualMachineId
A 128-bit identifier which uniquely identifies this Virtual Machine.
Declaration
public Output<string> VirtualMachineId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
VirtualMachineScaleSetId
Specifies the Orchestrated Virtual Machine Scale Set that this Virtual Machine should be created within. Changing this forces a new resource to be created.
Declaration
public Output<string> VirtualMachineScaleSetId { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
WinrmListeners
One or more winrm_listener blocks as defined below.
Declaration
public Output<ImmutableArray<WindowsVirtualMachineWinrmListener>> WinrmListeners { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.Collections.Immutable.ImmutableArray<WindowsVirtualMachineWinrmListener>> |
Zone
The Zone in which this Virtual Machine should be created. Changing this forces a new resource to be created.
Declaration
public Output<string> Zone { get; }
Property Value
| Type | Description |
|---|---|
| Output<System.String> |
Methods
View SourceGet(String, Input<String>, WindowsVirtualMachineState, CustomResourceOptions)
Get an existing WindowsVirtualMachine resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
Declaration
public static WindowsVirtualMachine Get(string name, Input<string> id, WindowsVirtualMachineState state = null, CustomResourceOptions options = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | The unique name of the resulting resource. |
| Input<System.String> | id | The unique provider ID of the resource to lookup. |
| WindowsVirtualMachineState | state | Any extra arguments used during the lookup. |
| CustomResourceOptions | options | A bag of options that control this resource's behavior |
Returns
| Type | Description |
|---|---|
| WindowsVirtualMachine |