Skip to content

azurermOrchestratedVirtualMachineScaleSet

Manages an Orchestrated Virtual Machine Scale Set.

Disclaimers

-> NOTE: As of the v2.86.0 (November 19, 2021) release of the provider this resource will only create Virtual Machine Scale Sets with the Flexible Orchestration Mode.

-> NOTE: All arguments including the administrator login and password will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as azurerm from "./.gen/providers/azurerm";
/*The following providers are missing schema information and might need manual adjustments to synthesize correctly: azurerm.
For a more precise conversion please use the --provider flag in convert.*/
const azurermResourceGroupExample = new azurerm.resourceGroup.ResourceGroup(
  this,
  "example",
  {
    location: "West Europe",
    name: "example-resources",
  }
);
const azurermOrchestratedVirtualMachineScaleSetExample =
  new azurerm.orchestratedVirtualMachineScaleSet.OrchestratedVirtualMachineScaleSet(
    this,
    "example_1",
    {
      location: azurermResourceGroupExample.location,
      name: "example-VMSS",
      platform_fault_domain_count: 1,
      resource_group_name: azurermResourceGroupExample.name,
      zones: ["1"],
    }
  );
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
azurermOrchestratedVirtualMachineScaleSetExample.overrideLogicalId("example");

Argument Reference

  • name - (Required) The name of the Orchestrated Virtual Machine Scale Set. Changing this forces a new resource to be created.

  • location - (Required) The Azure location where the Orchestrated Virtual Machine Scale Set should exist. Changing this forces a new resource to be created.

  • resourceGroupName - (Required) The name of the Resource Group in which the Orchestrated Virtual Machine Scale Set should exist. Changing this forces a new resource to be created.

  • platformFaultDomainCount - (Required) Specifies the number of fault domains that are used by this Orchestrated Virtual Machine Scale Set. Changing this forces a new resource to be created.

-> NOTE: The number of Fault Domains varies depending on which Azure Region you're using - a list can be found here.

  • skuName - (Optional) The name of the SKU to be used by this Orcestrated Virtual Machine Scale Set. Valid values include: any of the General purpose, Compute optimized, Memory optimized, Storage optimized, GPU optimized, FPGA optimized, High performance, or Previous generation virtual machine SKUs.

  • additionalCapabilities - (Optional) An additionalCapabilities block as defined below.

  • encryptionAtHostEnabled - (Optional) Should disks attached to this Virtual Machine Scale Set be encrypted by enabling Encryption at Host?

  • instances - (Optional) The number of Virtual Machines in the Orcestrated Virtual Machine Scale Set.

  • networkInterface - (Optional) One or more networkInterface blocks as defined below.

  • osProfile - (Optional) An osProfile block as defined below.

  • osDisk - (Optional) An osDisk block as defined below.

  • automaticInstanceRepair - (Optional) An automaticInstanceRepair block as defined below.

-> NOTE: To enable the automaticInstanceRepair, the Orchestrated Virtual Machine Scale Set must have a valid healthProbeId or an Application Health Extension.

  • bootDiagnostics - (Optional) A bootDiagnostics block as defined below.

  • capacityReservationGroupId - (Optional) Specifies the ID of the Capacity Reservation Group which the Virtual Machine Scale Set should be allocated to. Changing this forces a new resource to be created.

-> NOTE: capacityReservationGroupId cannot be specified with proximityPlacementGroupId

-> NOTE: If capacityReservationGroupId is specified the singlePlacementGroup must be set to false.

  • dataDisk - (Optional) One or more dataDisk blocks as defined below.

  • extension - (Optional) One or more extension blocks as defined below

  • extensionOperationsEnabled - (Optional) Should extension operations be allowed on the Virtual Machine Scale Set? Possible values are true or false. Defaults to true. Changing this forces a new Orchestrated Virtual Machine Scale Set to be created.

-> NOTE: extensionOperationsEnabled may only be set to false if there are no extensions defined in the extension field.

  • extensionsTimeBudget - (Optional) 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).

  • evictionPolicy - (Optional) The Policy which should be used Virtual Machines are Evicted from the Scale Set. Possible values are deallocate and delete. Changing this forces a new resource to be created.

  • identity - (Optional) An identity block as defined below.

  • licenseType - (Optional) Specifies the type of on-premise license (also known as Azure Hybrid Use Benefit) which should be used for this Orchestrated Virtual Machine Scale Set. Possible values are none, windowsClient and windowsServer.

  • maxBidPrice - (Optional) The maximum price you're willing to pay for each Orchestrated Virtual Machine in this Scale Set, in US Dollars; which must be greater than the current spot price. If this bid price falls below the current spot price the Virtual Machines in the Scale Set will be evicted using the eviction_policy. Defaults to 1, which means that each Virtual Machine in the Orchestrated Scale Set should not be evicted for price reasons.

  • plan - (Optional) A plan block as documented below. Changing this forces a new resource to be created.

  • priority - (Optional) The Priority of this Orchestrated Virtual Machine Scale Set. Possible values are regular and spot. Defaults to regular. Changing this value forces a new resource.

  • singlePlacementGroup - (Optional) Should this Virtual Machine Scale Set be limited to a Single Placement Group, which means the number of instances will be capped at 100 Virtual Machines. Possible values are true or false.

-> NOTE: singlePlacementGroup behaves differently for Orchestrated Virtual Machine Scale Sets than it does for other Virtual Machine Scale Sets. If you do not define the singlePlacementGroup field in your configuration file the service will determin what this value should be based off of the value contained within the skuName field of your configuration file. You may set the singlePlacementGroup field to true, however once you set it to false you will not be able to revert it back to true. If you wish to use Specialty Sku virtual machines (e.g. M-Seiries virtual machines) you will need to contact you Microsoft support professional and request to be added to the include list since this feature is currently in private preview until the end of September 2022. Once you have been added to the private preview include list you will need to run the following command to register your subscription with the feature: azFeatureRegisterNamespaceMicrosoftComputeNameSpecialSkusForVmssFlex. If you are not on the include list this command will error out with the following error message (featureRegistrationUnsupported)TheFeature 'specialSkusForVmssFlex'DoesNotSupportRegistration.

  • sourceImageId - (Optional) The ID of an Image which each Virtual Machine in this Scale Set should be based on. Possible Image ID types include imageIds, sharedImageIds, sharedImageVersionIds, communityGalleryImageIds, communityGalleryImageVersionIds, sharedGalleryImageIds and sharedGalleryImageVersionIds.

  • sourceImageReference - (Optional) A sourceImageReference block as defined below.

  • terminationNotification - (Optional) A terminationNotification block as defined below.

  • userDataBase64 - (Optional) The Base64-Encoded User Data which should be used for this Virtual Machine Scale Set.

  • proximityPlacementGroupId - (Optional) The ID of the Proximity Placement Group which the Orchestrated Virtual Machine should be assigned to. Changing this forces a new resource to be created.

  • zoneBalance - (Optional) Should the Virtual Machines in this Scale Set be strictly evenly distributed across Availability Zones? Defaults to false. Changing this forces a new resource to be created.

-> NOTE: This can only be set to true when one or more zones are configured.

  • zones - (Optional) Specifies a list of Availability Zones in which this Orchestrated Virtual Machine should be located. Changing this forces a new Orchestrated Virtual Machine to be created.

-> NOTE: Due to a limitation of the Azure API at this time only one Availability Zone can be defined.

  • tags - (Optional) A mapping of tags which should be assigned to this Orchestrated Virtual Machine Scale Set.

  • priorityMix - (Optional) a priorityMix block as defined below


An additionalCapabilities block supports the following:

  • ultraSsdEnabled - (Optional) Should the capacity to enable Data Disks of the ultraSsdLrs storage account type be supported on this Orchestrated Virtual Machine Scale Set? Defaults to false. Changing this forces a new resource to be created.

An osProfile block supports the following:

  • customData - (Optional) The Base64-Encoded Custom Data which should be used for this Orchestrated Virtual Machine Scale Set.

-> NOTE: When Custom Data has been configured, it's not possible to remove it without tainting the Orchestrated Virtual Machine Scale Set, due to a limitation of the Azure API.

  • windowsConfiguration - (Optional) A windowsConfiguration block as documented below.

  • linuxConfiguration - (Optional) A linuxConfiguration block as documented below.


A windowsConfiguration block supports the following:

  • adminUsername - (Required) The username of the local administrator on each Orchestrated Virtual Machine Scale Set instance. Changing this forces a new resource to be created.

  • adminPassword - (Required) The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.

  • computerNamePrefix - (Optional) The prefix which should be used for the name of the Virtual Machines in this Scale Set. If unspecified this defaults to the value for the name field. If the value of the name field is not a valid computerNamePrefix, then you must specify computerNamePrefix. Changing this forces a new resource to be created.

  • enableAutomaticUpdates - (Optional) Are automatic updates enabled for this Virtual Machine? Defaults to true.

  • hotpatchingEnabled - (Optional) 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.

-> 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, the VM's skuName is set to a Azure generation 2 VM SKU and the extension contains an application health extension. An example of how to correctly configure a Orchestrated Virtual Machine Scale Set to provision a Windows Virtual Machine with hotpatching enabled can be found in the /examples/orchestratedVmScaleSet/hotpatchingEnabled directory within the GitHub Repository.

  • patchAssessmentMode - (Optional) Specifies the mode of VM Guest Patching for the virtual machines that are associated to the Orchestrated Virtual Machine Scale Set. 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.

  • patchMode - (Optional) Specifies the mode of in-guest patching of 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.

-> NOTE: If patchMode is set to automaticByPlatform the provisionVmAgent must be set to true and the extension must contain at least one application health extension.

  • provisionVmAgent - (Optional) Should the Azure VM Agent be provisioned on each Virtual Machine in the Scale Set? Defaults to true. Changing this value forces a new resource to be created.

  • secret - (Optional) One or more secret blocks as defined below.

  • timezone - (Optional) Specifies the time zone of the virtual machine, the possible values are defined here.

  • winrmListener - (Optional) One or more winrmListener blocks as defined below. Changing this forces a new resource to be created.


A linuxConfiguration block supports the following:

  • adminUsername - (Required) The username of the local administrator on each Orchestrated Virtual Machine Scale Set instance. Changing this forces a new resource to be created.

  • adminPassword - (Optional) The Password which should be used for the local-administrator on this Virtual Machine. Changing this forces a new resource to be created.

  • adminSshKey - (Optional) A adminSshKey block as documented below.

  • computerNamePrefix - (Optional) The prefix which should be used for the name of the Virtual Machines in this Scale Set. If unspecified this defaults to the value for the name field. If the value of the name field is not a valid computerNamePrefix, then you must specify computerNamePrefix. Changing this forces a new resource to be created.

  • disablePasswordAuthentication - (Optional) When an adminPassword is specified disablePasswordAuthentication must be set to false. Defaults to true.

-> NOTE: Either adminPassword or adminSshKey must be specified.

  • patchAssessmentMode - (Optional) Specifies the mode of VM Guest Patching for the virtual machines that are associated to the Orchestrated Virtual Machine Scale Set. 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.

  • patchMode - (Optional) Specifies the mode of in-guest patching of this Windows Virtual Machine. Possible values are imageDefault or automaticByPlatform. Defaults to imageDefault. For more information on patch modes please see the product documentation.

-> NOTE: If patchMode is set to automaticByPlatform the provisionVmAgent must be set to true and the extension must contain at least one application health extension. An example of how to correctly configure a Orchestrated Virtual Machine Scale Set to provision a Linux Virtual Machine with Automatic VM Guest Patching enabled can be found in the /examples/orchestratedVmScaleSet/automaticVmGuestPatching directory within the GitHub Repository.

  • provisionVmAgent - (Optional) Should the Azure VM Agent be provisioned on each Virtual Machine in the Scale Set? Defaults to true. Changing this value forces a new resource to be created.

  • secret - (Optional) One or more secret blocks as defined below.


A secret block supports the following:

  • keyVaultId - (Required) The ID of the Key Vault from which all Secrets should be sourced.

  • certificate - (Required) One or more certificate blocks as defined below.

-> NOTE: The schema of the certificate block is slightly different depending on if you are provisioning a windowsConfiguration or a linuxConfiguration.


A (Windows) certificate block supports the following:

  • store - (Required) The certificate store on the Virtual Machine where the certificate should be added.

  • url - (Required) The Secret URL of a Key Vault Certificate.


A (Linux) certificate block supports the following:

  • url - (Required) The Secret URL of a Key Vault Certificate.

An adminSshKey block supports the following:

  • publicKey - (Required) The Public Key which should be used for authentication, which needs to be at least 2048-bit and in ssh-rsa format.

  • username - (Required) The Username for which this Public SSH Key should be configured.

-> NOTE: The Azure VM Agent only allows creating SSH Keys at the path /home/{username}/Ssh/authorizedKeys - as such this public key will be written to the authorized keys file.


A winrmListener block supports the following:

  • protocol - (Required) Specifies the protocol of listener. Possible values are http or https. Changing this forces a new resource to be created.

  • certificateUrl - (Optional) The Secret URL of a Key Vault Certificate, which must be specified when protocol is set to https. Changing this forces a new resource to be created.

-> NOTE: This can be sourced from the secretId field within the azurermKeyVaultCertificate Resource.


An automaticInstanceRepair block supports the following:

  • enabled - (Required) Should the automatic instance repair be enabled on this Orchestrated Virtual Machine Scale Set? Possible values are true and false.

  • gracePeriod - (Optional) Amount of time for which automatic repairs will be delayed. The grace period starts right after the VM is found unhealthy. Possible values are between 30 and 90 minutes. Defaults to 30 minutes. The time duration should be specified in iso8601 format (e.g. pt30M to pt90M).


A bootDiagnostics block supports the following:

  • storageAccountUri - (Optional) The Primary/Secondary Endpoint for the Azure Storage Account which should be used to store Boot Diagnostics, including Console Output and Screenshots from the Hypervisor. By including a bootDiagnostics block without passing the storageAccountUri field will cause the API to utilize a Managed Storage Account to store the Boot Diagnostics output.

A certificate block supports the following:

  • store - (Required) The certificate store on the Virtual Machine where the certificate should be added.

  • url - (Required) The Secret URL of a Key Vault Certificate.

-> NOTE: This can be sourced from the secretId field within the azurermKeyVaultCertificate Resource.


A diffDiskSettings block supports the following:

  • option - (Required) Specifies the Ephemeral Disk Settings for the OS Disk. At this time the only possible value is local. Changing this forces a new resource to be created.

  • placement - (Optional) Specifies where to store the Ephemeral Disk. Possible values are cacheDisk and resourceDisk. Defaults to cacheDisk. Changing this forces a new resource to be created.


A dataDisk block supports the following:

  • caching - (Required) The type of Caching which should be used for this Data Disk. Possible values are None, ReadOnly and ReadWrite.

  • createOption - (Optional) The create option which should be used for this Data Disk. Possible values are Empty and FromImage. Defaults to empty. (FromImage should only be used if the source image includes data disks).

  • diskSizeGb - (Required) The size of the Data Disk which should be created.

  • lun - (Required) The Logical Unit Number of the Data Disk, which must be unique within the Virtual Machine.

  • storageAccountType - (Required) The Type of Storage Account which should back this Data Disk. Possible values include standardLrs, standardSsdLrs, standardSsdZrs, premiumLrs, premiumV2Lrs, premiumZrs and ultraSsdLrs.

  • diskEncryptionSetId - (Optional) The ID of the Disk Encryption Set which should be used to encrypt the Data Disk. Changing this forces a new resource to be created.

  • ultraSsdDiskIopsReadWrite - (Optional) Specifies the Read-Write IOPS for this Data Disk. Only settable for UltraSSD disks.

  • ultraSsdDiskMbpsReadWrite - (Optional) Specifies the bandwidth in MB per second for this Data Disk. Only settable for UltraSSD disks.

  • writeAcceleratorEnabled - (Optional) Specifies if Write Accelerator is enabled on the Data Disk. Defaults to false.


An extension block supports the following:

  • name - (Required) The name for the Virtual Machine Scale Set Extension.

  • publisher - (Required) Specifies the Publisher of the Extension.

  • type - (Required) Specifies the Type of the Extension.

  • typeHandlerVersion - (Required) Specifies the version of the extension to use, available versions can be found using the Azure CLI.

  • autoUpgradeMinorVersionEnabled - (Optional) Should the latest version of the Extension be used at Deployment Time, if one is available? This won't auto-update the extension on existing installation. Defaults to true.

  • extensionsToProvisionAfterVmCreation - (Optional) An ordered list of Extension names which Orchestrated Virtual Machine Scale Set should provision after VM creation.

  • forceExtensionExecutionOnChange - (Optional) A value which, when different to the previous value can be used to force-run the Extension even if the Extension Configuration hasn't changed.

  • protectedSettings - (Optional) A JSON String which specifies Sensitive Settings (such as Passwords) for the Extension.

-> NOTE: Keys within the protectedSettings block are notoriously case-sensitive, where the casing required (e.g. titleCase vs snakeCase) depends on the Extension being used. Please refer to the documentation for the specific Orchestrated Virtual Machine Extension you're looking to use for more information.

  • protectedSettingsFromKeyVault - (Optional) A protectedSettingsFromKeyVault block as defined below.

\~> Note: protectedSettingsFromKeyVault cannot be used with protectedSettings

  • failureSuppressionEnabled - (Optional) Should failures from the extension be suppressed? Possible values are true or false.

-> NOTE: Operational failures such as not connecting to the VM will not be suppressed regardless of the failureSuppressionEnabled value.

  • settings - (Optional) A JSON String which specifies Settings for the Extension.

An ipConfiguration block supports the following:

  • name - (Required) The Name which should be used for this IP Configuration.

  • applicationGatewayBackendAddressPoolIds - (Optional) A list of Backend Address Pools IDs from a Application Gateway which this Orchestrated Virtual Machine Scale Set should be connected to.

  • applicationSecurityGroupIds - (Optional) A list of Application Security Group IDs which this Orchestrated Virtual Machine Scale Set should be connected to.

  • loadBalancerBackendAddressPoolIds - (Optional) A list of Backend Address Pools IDs from a Load Balancer which this Orchestrated Virtual Machine Scale Set should be connected to.

-> NOTE: When using this field you'll also need to configure a Rule for the Load Balancer, and use a depends_on between this resource and the Load Balancer Rule.

  • primary - (Optional) Is this the Primary IP Configuration for this Network Interface? Possible values are true and false. Defaults to false.

-> NOTE: One ipConfiguration block must be marked as Primary for each Network Interface.

  • publicIpAddress - (Optional) A publicIpAddress block as defined below.

  • subnetId - (Optional) The ID of the Subnet which this IP Configuration should be connected to.

-> NOTE: subnetId is required if version is set to iPv4.

  • version - (Optional) The Internet Protocol Version which should be used for this IP Configuration. Possible values are iPv4 and iPv6. Defaults to iPv4.

An ipTag block supports the following:

  • tag - (Required) The IP Tag associated with the Public IP, such as sql or storage. Changing this forces a new resource to be created.

  • type - (Required) The Type of IP Tag, such as firstPartyUsage. Changing this forces a new resource to be created.


A networkInterface block supports the following:

  • name - (Required) The Name which should be used for this Network Interface. Changing this forces a new resource to be created.

  • ipConfiguration - (Required) One or more ipConfiguration blocks as defined above.

  • dnsServers - (Optional) A list of IP Addresses of DNS Servers which should be assigned to the Network Interface.

  • enableAcceleratedNetworking - (Optional) Does this Network Interface support Accelerated Networking? Possible values are true and false. Defaults to false.

  • enableIpForwarding - (Optional) Does this Network Interface support IP Forwarding? Possible values are true and false. Defaults to false.

  • networkSecurityGroupId - (Optional) The ID of a Network Security Group which should be assigned to this Network Interface.

  • primary - (Optional) Is this the Primary IP Configuration? Possible values are true and false. Defaults to false.

-> NOTE: If multiple networkInterface blocks are specified, one must be set to primary.


An osDisk block supports the following:

  • caching - (Required) The Type of Caching which should be used for the Internal OS Disk. Possible values are none, readOnly and readWrite.

  • storageAccountType - (Required) The Type of Storage Account which should back this the Internal OS Disk. Possible values include standardLrs, standardSsdLrs, standardSsdZrs, premiumLrs and premiumZrs. Changing this forces a new resource to be created.

  • diffDiskSettings - (Optional) A diffDiskSettings block as defined above. Changing this forces a new resource to be created.

  • diskEncryptionSetId - (Optional) The ID of the Disk Encryption Set which should be used to encrypt this OS Disk. Changing this forces a new resource to be created.

-> NOTE: Disk Encryption Sets are in Public Preview in a limited set of regions

  • diskSizeGb - (Optional) The Size of the Internal OS Disk in GB, if you wish to vary from the size used in the image this Virtual Machine Scale Set is sourced from.

  • writeAcceleratorEnabled - (Optional) Specifies if Write Accelerator is enabled on the OS Disk. Defaults to false.


A plan block supports the following:

  • name - (Required) Specifies the name of the image from the marketplace. Changing this forces a new resource to be created.

  • publisher - (Required) Specifies the publisher of the image. Changing this forces a new resource to be created.

  • product - (Required) Specifies the product of the image from the marketplace. Changing this forces a new resource to be created.


A protectedSettingsFromKeyVault block supports the following:

  • secretUrl - (Required) The URL to the Key Vault Secret which stores the protected settings.

  • sourceVaultId - (Required) The ID of the source Key Vault.


An identity block supports the following:

  • type - (Required) The type of Managed Identity that should be configured on this Orchestrated Windows Virtual Machine Scale Set. Only possible value is userAssigned.

  • identityIds - (Required) Specifies a list of User Managed Identity IDs to be assigned to this Orchestrated Windows Virtual Machine Scale Set.


A publicIpAddress block supports the following:

  • name - (Required) The Name of the Public IP Address Configuration.

  • domainNameLabel - (Optional) The Prefix which should be used for the Domain Name Label for each Virtual Machine Instance. Azure concatenates the Domain Name Label and Virtual Machine Index to create a unique Domain Name Label for each Virtual Machine. Valid values must be between 1 and 26 characters long, start with a lower case letter, end with a lower case letter or number and contains only aZ, 09 and hyphens.

  • idleTimeoutInMinutes - (Optional) The Idle Timeout in Minutes for the Public IP Address. Possible values are in the range 4 to 32.

  • ipTag - (Optional) One or more ipTag blocks as defined above. Changing this forces a new resource to be created.

  • publicIpPrefixId - (Optional) The ID of the Public IP Address Prefix from where Public IP Addresses should be allocated. Changing this forces a new resource to be created.

  • skuName - (Optional) Specifies what Public IP Address SKU the Public IP Address should be provisioned as. Possible vaules include basicRegional, basicGlobal, standardRegional or standardGlobal. For more information about Public IP Address SKU's and their capabilities, please see the product documentation. Changing this forces a new resource to be created.

  • version - (Optional) The Internet Protocol Version which should be used for this public IP address. Possible values are iPv4 and iPv6. Defaults to iPv4. Changing this forces a new resource to be created.


A terminationNotification block supports the following:

  • enabled - (Required) Should the termination notification be enabled on this Virtual Machine Scale Set? Possible values true or false

  • timeout - (Optional) Length of time (in minutes, between 5 and 15) a notification to be sent to the VM on the instance metadata server till the VM gets deleted. The time duration should be specified in iso8601 format. Defaults to pt5M.


A sourceImageReference block supports the following:

  • publisher - (Required) Specifies the publisher of the image used to create the virtual machines. Changing this forces a new resource to be created.

  • offer - (Required) Specifies the offer of the image used to create the virtual machines. Changing this forces a new resource to be created.

  • sku - (Required) Specifies the SKU of the image used to create the virtual machines.

  • version - (Required) Specifies the version of the image used to create the virtual machines.


A priorityMix block supports the following:

  • baseRegularCount - (Optional) Specifies the base number of VMs of regular priority that will be created before any VMs of priority spot are created. Possible values are integers between 0 and 1000. Defaults to 0.

  • regularPercentageAboveBase - (Optional) Specifies the desired percentage of VM instances that are of regular priority after the base count has been reached. Possible values are integers between 0 and 100. Defaults to 0.


Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The ID of the Orchestrated Virtual Machine Scale Set.

  • uniqueId - The Unique ID for the Orchestrated Virtual Machine Scale Set.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 60 minutes) Used when creating the Orchestrated Virtual Machine Scale Set.
  • update - (Defaults to 60 minutes) Used when updating the Orchestrated Virtual Machine Scale Set.
  • read - (Defaults to 5 minutes) Used when retrieving the Orchestrated Virtual Machine Scale Set.
  • delete - (Defaults to 60 minutes) Used when deleting the Orchestrated Virtual Machine Scale Set.

Import

An Orchestrated Virtual Machine Scale Set can be imported using the resourceId, e.g.

terraform import azurerm_orchestrated_virtual_machine_scale_set.example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Compute/virtualMachineScaleSets/scaleset1