From 8a4a295e86678784f3397012c325b2301f6a2cf9 Mon Sep 17 00:00:00 2001 From: hezijie Date: Mon, 11 Nov 2024 15:14:19 +0800 Subject: [PATCH] add support for disk_controller_type --- README.md | 1 + main.tf | 2 ++ variables.tf | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 27af429..06f1ccc 100644 --- a/README.md +++ b/README.md @@ -260,6 +260,7 @@ No modules. | [dedicated\_host\_group\_id](#input\_dedicated\_host\_group\_id) | (Optional) The ID of a Dedicated Host Group that this Linux Virtual Machine should be run within. Conflicts with `dedicated_host_id`. | `string` | `null` | no | | [dedicated\_host\_id](#input\_dedicated\_host\_id) | (Optional) The ID of a Dedicated Host where this machine should be run on. Conflicts with `dedicated_host_group_id`. | `string` | `null` | no | | [disable\_password\_authentication](#input\_disable\_password\_authentication) | (Optional) Should Password Authentication be disabled on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created. | `bool` | `true` | no | +| [disk\_controller\_type](#input\_disk\_controller\_type) | (Optional) Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`. | `string` | `null` | no | | [edge\_zone](#input\_edge\_zone) | (Optional) Specifies the Edge Zone within the Azure Region where this Linux Virtual Machine should exist. Changing this forces a new Virtual Machine to be created. | `string` | `null` | no | | [encryption\_at\_host\_enabled](#input\_encryption\_at\_host\_enabled) | (Optional) Should all of the disks (including the temp disk) attached to this Virtual Machine be encrypted by enabling Encryption at Host? | `bool` | `null` | no | | [eviction\_policy](#input\_eviction\_policy) | (Optional) Specifies what should happen when the Virtual Machine is evicted for price reasons when using a Spot instance. Possible values are `Deallocate` and `Delete`. Changing this forces a new resource to be created. | `string` | `null` | no | diff --git a/main.tf b/main.tf index 1325c10..1bfdc47 100644 --- a/main.tf +++ b/main.tf @@ -110,6 +110,7 @@ resource "azurerm_linux_virtual_machine" "vm_linux" { dedicated_host_group_id = var.dedicated_host_group_id dedicated_host_id = var.dedicated_host_id disable_password_authentication = var.disable_password_authentication + disk_controller_type = var.disk_controller_type edge_zone = var.edge_zone encryption_at_host_enabled = var.encryption_at_host_enabled eviction_policy = var.eviction_policy @@ -310,6 +311,7 @@ resource "azurerm_windows_virtual_machine" "vm_windows" { custom_data = var.custom_data dedicated_host_group_id = var.dedicated_host_group_id dedicated_host_id = var.dedicated_host_id + disk_controller_type = var.disk_controller_type edge_zone = var.edge_zone enable_automatic_updates = var.automatic_updates_enabled encryption_at_host_enabled = var.encryption_at_host_enabled diff --git a/variables.tf b/variables.tf index 8136d25..2ec20d9 100644 --- a/variables.tf +++ b/variables.tf @@ -296,6 +296,12 @@ variable "disable_password_authentication" { description = "(Optional) Should Password Authentication be disabled on this Virtual Machine? Defaults to `true`. Changing this forces a new resource to be created." } +variable "disk_controller_type" { + type = string + default = null + description = "(Optional) Specifies the Disk Controller Type used for this Virtual Machine. Possible values are `SCSI` and `NVMe`." +} + variable "edge_zone" { type = string default = null