Skip to content

dmedeiros204/terraform-azurerm-vmss

Repository files navigation

Requirements

Name Version
terraform >= 0.13
azurerm >= 2.60.0

Providers

Name Version
azurerm >= 2.60.0
random n/a
tls n/a

Modules

No modules.

Resources

Name Type
azurerm_linux_virtual_machine_scale_set.main resource
azurerm_monitor_autoscale_setting.auto resource
azurerm_monitor_diagnostic_setting.custom resource
azurerm_storage_account.main resource
azurerm_virtual_machine_scale_set_extension.custom resource
azurerm_virtual_machine_scale_set_extension.linux resource
azurerm_virtual_machine_scale_set_extension.omsagentlinux resource
azurerm_virtual_machine_scale_set_extension.omsagentwin resource
azurerm_windows_virtual_machine_scale_set.main resource
random_password.passwd resource
random_string.primary resource
random_string.username resource
tls_private_key.key resource
azurerm_monitor_diagnostic_categories.main data source
azurerm_shared_image.main data source

Inputs

Name Description Type Default Required
additional_data_disks Adding additional disks capacity to add each instance (GB) list(number) [] no
additional_data_disks_storage_account_type The Type of Storage Account which should back this Data Disk. Possible values include Standard_LRS, StandardSSD_LRS, Premium_LRS and UltraSSD_LRS. string "Premium_LRS" no
admin_ssh_key_data specify the path to the existing ssh key to authenciate linux vm if generate ssh key is set to false string "" no
admin_username Specify a prefered Admin Username. If not specified a random username will be created string null no
availability_zone_balance Should the Virtual Machines in this Scale Set be strictly evenly distributed across Availability Zones? bool true no
availability_zones A list of Availability Zones in which the Virtual Machines in this Scale Set should be created in list
[
1,
2,
3
]
no
computer_name_prefix Specifies the name prefix of the virtual machine inside the VM scale set any n/a yes
custom_data The Base64-Encoded Custom Data which should be used for this Virtual Machine Scale Set. string null no
custom_extension A custom extension block see https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_machine_scale_set_extension
object({
publisher = string
type = string
type_handler_version = string
settings = map(any)
protected_settings = map(any)
provision_after_extensions = list(string)
})
null no
data_disk_caching The type of Caching which should be used for this Data Disk string "ReadWrite" no
data_disk_create_option 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). string "Empty" no
deploy_log_analytics_agent Provide the workspace ID and the workspace Key to install the log analytics agent.
object({
workspace_id = string
workspace_key = string
})
null no
diagnostics Diagnostic settings for those resources that support it.
object({
destination = string
eventhub_name = string
logs = list(string)
metrics = list(string)
})
null no
diff_disk_settings Enables the diff disk setting. Currently only Local is supported bool false no
disable_automatic_rollback Should automatic rollbacks be disabled bool true no
disk_size_gb 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. number null no
do_not_run_extensions_on_overprovisioned_machines Should Virtual Machine Extensions be run on Overprovisioned Virtual Machines in the Scale Set? bool false no
enable_automatic_instance_repair Should the automatic instance repair be enabled on this Virtual Machine Scale Set? string false no
enable_automatic_os_upgrade Should OS Upgrades automatically be applied to Scale Set instances in a rolling fashion when a newer version of the OS Image becomes available bool true no
enable_autoscale_for_vmss Manages a AutoScale Setting which can be applied to Virtual Machine Scale Sets bool false no
enable_boot_diag Enable Boot Diagnostic Storage Account bool true no
enable_health_extension Enable the Application Health extension on the VMSS scale set. Only Linux Currently Supported bool false no
encryption_at_host_enabled Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? bool false no
environment Which enviroment dev, qa, stage, production string n/a yes
generate_admin_ssh_key Generates a secure private key and encodes it as PEM. bool true no
grace_period Amount of time (in minutes, between 30 and 90, defaults to 30 minutes) for which automatic repairs will be delayed. string "PT30M" no
health_probe_id The ID of a Load Balancer Probe which should be used to determine the health of an instance. This is Required and can only be specified when upgrade_mode is set to Automatic or Rolling. any null no
instances_count The number of Virtual Machines in the Scale Set. number 1 no
location (Optional) The location in which the resources will be created. Defaults to Canada Central string "Canada Central" no
marketplace_image Provide the marketplace image info
object({
publisher = string
offer = string
sku = string
version = string
})
null no
max_batch_instance_percent The maximum percent of total virtual machine instances that will be upgraded simultaneously by the rolling upgrade in one batch. As this is a maximum, unhealthy instances in previous or future batches can cause the percentage of instances in a batch to decrease to ensure higher reliability. Changing this forces a new resource to be created number 20 no
max_unhealthy_instance_percent The maximum percentage of the total virtual machine instances in the scale set that can be simultaneously unhealthy, either as a result of being upgraded, or by being found in an unhealthy state by the virtual machine health checks before the rolling upgrade aborts. This constraint will be checked prior to starting any batch. Changing this forces a new resource to be created. number 20 no
max_unhealthy_upgraded_instance_percent The maximum percentage of upgraded virtual machine instances that can be found to be in an unhealthy state. This check will happen after each batch is upgraded. If this percentage is ever exceeded, the rolling update aborts. Changing this forces a new resource to be created. number 20 no
maximum_instances_count The maximum number of instances for this resource. Valid values are between 0 and 1000 string "" no
minimum_instances_count The minimum number of instances for this resource. Valid values are between 0 and 1000 any null no
network_config A list of network interfaces to be applied to each scale set
list(object({
primary = bool,
vnet_subnet_id = string,
dns_servers = list(string),
enable_ip_forwarding = bool,
enable_accelerated_networking = bool,
network_security_group_id = string,
load_balancer_backend_address_pool_ids = list(string),
load_balancer_inbound_nat_rules_ids = list(string),
application_gateway_backend_address_pool_ids = list(string)
}))
n/a yes
os_disk_caching The Type of Caching which should be used for the Internal OS Disk. Possible values are None, ReadOnly and ReadWrite string "ReadOnly" no
os_disk_storage_account_type The Type of Storage Account which should back this the Internal OS Disk. Possible values include Standard_LRS, StandardSSD_LRS and Premium_LRS. string "Standard_LRS" no
os_flavor Specify the flavour of the operating system image to deploy VMSS. Valid values are windows and linux string "linux" no
os_upgrade_mode Specifies how Upgrades (e.g. changing the Image/SKU) should be performed to Virtual Machine Instances. Possible values are Automatic, Manual and Rolling. Defaults to Manual string "Manual" no
overprovision Should Azure over-provision Virtual Machines in this Scale Set? This means that multiple Virtual Machines will be provisioned and Azure will keep the instances which become available first - which improves provisioning success rates and improves deployment time. You're not billed for these over-provisioned VM's and they don't count towards the Subscription Quota. Defaults to true. bool false no
pause_time_between_batches The wait time between completing the update for all virtual machines in one batch and starting the next batch. The time duration should be specified in ISO 8601 format. Changing this forces a new resource to be created string "PT0S" no
priority The Priority of this Virtual Machine Scale Set. Possible values are Regular and Spot string "Regular" no
provision_vm_agent Should the Azure VM Agent be provisioned on each Virtual Machine in the Scale Set? bool true no
resource_group_name The name of the resource group in which the resources will be created. string n/a yes
scale_in_cpu_percentage_threshold Specifies the threshold of the metric that triggers the scale in action. string "20" no
scale_in_policy The scale-in policy rule that decides which virtual machines are chosen for removal when a Virtual Machine Scale Set is scaled in. Possible values for the scale-in policy rules are Default, NewestVM and OldestVM, defaults to Default string "Default" no
scale_out_cpu_percentage_threshold Specifies the threshold % of the metric that triggers the scale out action. string "80" no
scaling_action_instances_number The number of instances involved in the scaling action string "1" no
shared_image Provide the Shared Image Gallery image info
object({
image_name = string,
image_gallery_name = string,
image_gallery_rg = string,
})
null no
single_placement_group Allow to have cluster of 100 VMs only bool true no
tags Tags to apply to all resources created. map(string) {} no
ultra_ssd_enabled Should the capacity to enable Data Disks of the UltraSSD_LRS storage account type be supported on this Virtual Machine Scale Set? Defaults to false string "false" no
virtual_machine_size The Virtual Machine SKU for the Scale Set, Default is Standard_A2_V2 string "Standard_D2s_v3" no
vmss_name Specifies the name of the virtual machine scale set resource. Prefix vmss- will be applied any n/a yes
write_accelerator_enabled Should Write Accelerator be enabled for this Data Disk? bool false no

Outputs

Name Description
vmss_linux_id The ID of the Linux Virtual Machine Scale Set.
vmss_linux_identity The ID of the System Managed Service Principal.
vmss_windows_id The ID of the Linux Virtual Machine Scale Set.
vmss_windows_identity The ID of the System Managed Service Principal.