简体   繁体   中英

Terraform Azure provider - can OS disk be encrypted only with azurerm_linux_virtual_machine?

If so, what about other machines OS? I can only see the documentation of disk encryption inside the azurerm_linux_virtual_machine resource.

NO, Disk encryption also supports Windows Azure VM.

You could see an os_disk block supports the following:

在此处输入图片说明

The disk_encryption_set_id is used to encrypt this OS Disk from azurerm_windows_virtual_machine

Then to encrypt the OS disk, you will create azurerm_disk_encryption_set resource and reference it in the Azure VM OS disk like this:

  os_disk {
    caching              = "ReadWrite"
    storage_account_type = "Standard_LRS"
    
    disk_encryption_set_id = azurerm_disk_encryption_set.example.id   #use for disk encryption
  }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM