Skip to content

Commit 2a9992a

Browse files
committed
adding boot diagnostics, identity, automatic instance repair and additional capabilities blocks to Windows VM scale sets
1 parent 6bcad2e commit 2a9992a

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

main.tf

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,13 @@ resource "azurerm_windows_virtual_machine_scale_set" "winsrv_vmss" {
415415
write_accelerator_enabled = var.enable_os_disk_write_accelerator
416416
}
417417

418+
dynamic "additional_capabilities" {
419+
for_each = var.enable_ultra_ssd_data_disk_storage_support ? [1] : []
420+
content {
421+
ultra_ssd_enabled = var.enable_ultra_ssd_data_disk_storage_support
422+
}
423+
}
424+
418425
dynamic "data_disk" {
419426
for_each = var.additional_data_disks
420427
content {
@@ -469,9 +476,27 @@ resource "azurerm_windows_virtual_machine_scale_set" "winsrv_vmss" {
469476
}
470477
}
471478

472-
automatic_instance_repair {
473-
enabled = var.enable_automatic_instance_repair
474-
grace_period = var.grace_period
479+
dynamic "automatic_instance_repair" {
480+
for_each = var.enable_automatic_instance_repair ? [1] : []
481+
content {
482+
enabled = var.enable_automatic_instance_repair
483+
grace_period = var.grace_period
484+
}
485+
}
486+
487+
dynamic "identity" {
488+
for_each = var.managed_identity_type != null ? [1] : []
489+
content {
490+
type = var.managed_identity_type
491+
identity_ids = var.managed_identity_type == "UserAssigned" || var.managed_identity_type == "SystemAssigned, UserAssigned" ? var.managed_identity_ids : null
492+
}
493+
}
494+
495+
dynamic "boot_diagnostics" {
496+
for_each = var.enable_boot_diagnostics ? [1] : []
497+
content {
498+
storage_account_uri = var.storage_account_name != null ? data.azurerm_storage_account.storeacc.0.primary_blob_endpoint : var.storage_account_uri
499+
}
475500
}
476501

477502
# As per the recomendation by Terraform documentation

0 commit comments

Comments
 (0)