hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.49k stars 4.58k forks source link

Expose `os_disk.id` in `azurerm_linux_virtual_machine` and `azurerm_windows_virtual_machine` #26598

Open skgsergio opened 1 month ago

skgsergio commented 1 month ago

Is there an existing issue for this?

Community Note

Description

In some scenarios like creating a azurerm_data_protection_backup_instance_disk is useful to have the azurerm_linux_virtual_machine.example.os_disk[0].id in order to avoid having to do the extra step of creating a data.azurerm_managed_disk.example_os_disk resource.

AFAIK in go-azure-sdk the ID is already present in OSDisk.ManagedDisk.Id.

New or Affected Resource(s)/Data Source(s)

azurerm_linux_virtual_machine, azurerm_windows_virtual_machine

Potential Terraform Configuration

No response

References

No response

Chambras commented 1 month ago

Interesting @skgsergio I will try to take a look

jackofallops commented 1 month ago

Interesting @skgsergio I will try to take a look

Thanks for the issue @skgsergio, and for the enthusiasm @Chambras. We're looking at this as part of a larger piece of work sometime after the release of 4.0. It looks like a simple thing on the surface, but we need to be mindful of a number of other related changes so we don't block those by implementing something too early. If we can ask that contributors don't try and tackle this one until we've had opportunity to review the whole task, that would be appreciated as we'd likely end up needing to close PR's, which we prefer not to have to do.

Thanks!

Chambras commented 1 month ago

Thanks for the background and explanation @jackofallops I totally understand!