Azure / terraform-azurerm-avm-res-compute-virtualmachine

Terraform AVM module for virtual machines
MIT License
17 stars 26 forks source link

[AVM Module Issue]: diff_disk_settings not working for linux VM #37

Closed Laffs2k5 closed 7 months ago

Laffs2k5 commented 7 months ago

Check for previous/existing GitHub issues

Module specific issue

Issue Type?

Bug

(Optional) Module Version

0.7.0

(Optional) Correlation Id

No response

Description

The diff_disk_settings of input variable os_disk does not work for Linux VM's.

This code: https://github.com/Azure/terraform-azurerm-avm-res-compute-virtualmachine/blob/v0.7.0/main.linux_vm.tf#L53-L60

    dynamic "diff_disk_settings" {
      for_each = var.os_disk.diff_disk_settings == null ? [] : ["diff_disk_settings"]

      content {
        option    = var.diff_disk_settings.option
        placement = var.diff_disk_settings.placement
      }
    }

should be (notice the difference inside the content block):

    dynamic "diff_disk_settings" {
      for_each = var.os_disk.diff_disk_settings == null ? [] : ["diff_disk_settings"]

      content {
        option    = var.os_disk.diff_disk_settings.option
        placement = var.os_disk.diff_disk_settings.placement
      }
    }

Copied from main.windows_vm.tf which seems to be correctly declared.

jchancellor-ms commented 7 months ago

@Laffs2k5 - Thanks for catching this bug. I'll add the fix and push a release.

jchancellor-ms commented 7 months ago

@Laffs2k5 - this has been corrected in version 0.8.0. I'm closing this but can re-open if this doesn't correct your issue.