Generic module for creating a virtual machine (Windows or Linux) in Azure.
Using a unique count (machine_count) to prevent duplicates
Name | Version |
---|---|
terraform | >= 0.15 |
azurerm | >= 2.70.0 |
random | >= 3.1.0 |
Name | Version |
---|---|
azurerm | >= 2.70.0 |
random | >= 3.1.0 |
tls | n/a |
No modules.
Name | Type |
---|---|
azurerm_linux_virtual_machine.linux | resource |
azurerm_network_interface.dynamic | resource |
azurerm_public_ip.primary | resource |
azurerm_windows_virtual_machine.windows | resource |
random_integer.count | resource |
random_password.password | resource |
random_string.username | resource |
random_string.windows_name | resource |
tls_private_key.ssh_key | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
accelerated_networking | Enable accelerated networking? | bool |
false |
no |
admin_password | (Windows) Default Password - Random if left blank | string |
"" |
no |
admin_ssh_public_key | (Linux) Public SSH Key - Generated if left blank | string |
"" |
no |
admin_username | Default Username - Random if left blank | string |
"" |
no |
availability_zone | The Zone in which this Virtual Machine should be created. Changing this forces a new resource to be created. | number |
null |
no |
custom_data | The Base64-Encoded Custom Data which should be used for this Virtual Machine | string |
null |
no |
custom_image_id | Custom machine image ID | string |
null |
no |
diagnostics_storage_account_uri | The Storage Account's Blob Endpoint which should hold the virtual machine's diagnostic files. | string |
null |
no |
enable_boot_diagnostics | Whether to enable boot diagnostics on the virtual machine. | bool |
false |
no |
identity_ids | Specifies a list of user managed identity ids to be assigned to the VM | list(string) |
[] |
no |
identity_type | The Managed Service Identity Type of this Virtual Machine. Possible values are SystemAssigned (where Azure will generate a Managed Identity for you), UserAssigned (where you can specify the Managed Identities ID). | string |
"SystemAssigned" |
no |
kernel_type | Virtual machine kernel - windows or linux | string |
"linux" |
no |
linux_machine_name | Linux Virtual Machine Name - If left blank generated from metadata module | string |
"" |
no |
location | Azure region | string |
n/a | yes |
machine_count | Unique Identifier/Count - Random if left at 0 | number |
0 |
no |
names | names to be applied to resources | map(string) |
n/a | yes |
operating_system_disk_cache | Type of caching to use on the OS disk - Options: None, ReadOnly or ReadWrite | string |
"ReadWrite" |
no |
operating_system_disk_type | Type of storage account to use with the OS disk - Options: Standard_LRS, StandardSSD_LRS or Premium_LRS | string |
"StandardSSD_LRS" |
no |
operating_system_disk_write_accelerator | Should Write Accelerator be Enabled for this OS Disk? | bool |
false |
no |
proximity_placement_group | ID of the proximity_placement_group you want the VM to be a member of | string |
null |
no |
public_ip_enabled | Create and attach a public interface? | bool |
false |
no |
public_ip_sku | SKU to be used with this public IP - Basic or Standard | string |
"Standard" |
no |
resource_group_name | Resource group name | string |
n/a | yes |
source_image_offer | Operating System Name | string |
null |
no |
source_image_publisher | Operating System Publisher | string |
null |
no |
source_image_sku | Operating System SKU | string |
null |
no |
source_image_version | Operating System Version | string |
"latest" |
no |
subnet_id | Virtual network subnet ID | string |
n/a | yes |
tags | tags to be applied to resources | map(string) |
n/a | yes |
ultra_ssd_enabled | Should the capacity to enable Data Disks of the UltraSSD_LRS storage account type be supported on this Virtual Machine. | bool |
false |
no |
virtual_machine_size | Instance size to be provisioned | string |
n/a | yes |
windows_machine_name | Windows Virtual Machine Name - Max 15 characters. If left blank randomly assigned | string |
"" |
no |
Name | Description |
---|---|
admin_password | n/a |
admin_ssh_key | n/a |
admin_username | Credentials |
azurerm_network_interface_id | Interface id |
identity_principal_id | Identity |
virtual_machine_id | Virtal Machine Details |
virtual_machine_name | n/a |
virtual_machine_private_ip | n/a |