Closed tze-dev closed 1 year ago
Thanks @tl-aiyor for opening this issue, awesome suggestion, I like this idea! Would you like to submit a pr to implement this feature?
Btw, I think outputing attachments' id list is good enough, basically, we don't output resources directly. And this local
can be inlined into output's value
I think.
Hi @lonegunmanb, sounds good. I can definitely submit a pr. And agree on the attachments' id list as output.
Is there an existing issue for this?
Description
Currently the VM Extension.
azurerm_virtual_machine_extension.extensions
resource runs as soon as theazurerm_windows_virtual_machine
orazurerm_linux_virtual_machine
gets executed. However, there are cases where this is undesirable - e.g., if you want to attach multiple data disks to the VM and then use the VM Extension to configure span volumes across data disks -- In this case, the VM extension would run before the data disks are fully attached and therefore unable to properly complete the logic.What would be better is to allow VM extension to run after all data disks are fully attached. One way to do this is to make the resource,
azurerm_virtual_machine_extension.extensions
depends onazurerm_virtual_machine_data_disk_attachment.attachment
. And optionally, it would be great to also output theazurerm_virtual_machine_data_disk_attachment.attachment
from the module - this is so that if people want to apply VM Extension outside of the module, they can manage the dependency using the output of data disk attachment - before running VM extension from the caller module.New or Affected Resource(s)/Data Source(s)
azurerm_virtual_machine_extension.extensions
Potential Terraform Configuration
References
No response