terraform-provider-azapi
terraform-provider-azapi copied to clipboard
Microsoft.Compute/virtualMachines@2022-11-01 disks keep re-attaching
Terraform 1.4.4 azapi 1.6.0
resource "azapi_resource" "virtualmachine_rehosted" {
count = local.create_rehosted_virtual_machine ? 1 : 0
type = "Microsoft.Compute/virtualMachines@2022-11-01"
name = local.virtual_machine_name
location = var.location
parent_id = data.azurerm_resource_group.virtualmachine.id
body = jsonencode({
identity = {
type = "SystemAssigned"
}
properties = {
hardwareProfile = {
vmSize = var.vm_size
}
networkProfile = {
networkInterfaces = [{
id = azurerm_network_interface.virtualmachine[0].id
}]
}
storageProfile = {
osDisk = {
createOption = "Attach"
managedDisk = {
storageAccountType = var.disk_profiles.rehosted_machine.operating_system.disk_storage_account_type != null ? var.disk_profiles.rehosted_machine.operating_system.disk_storage_account_type : "StandardSSD_LRS"
id = azurerm_managed_disk.os_disk[0].id
}
osType = var.disk_profiles.disk_operating_system
name = azurerm_managed_disk.os_disk[0].name
}
dataDisks = local.hosted_data_disks
}
capacityReservation = {
capacityReservationGroup = {
id = local.create_capacity ? data.azapi_resource.support_capacity_group[0].id : null
}
}
diagnosticsProfile = {
bootDiagnostics = {
enabled = var.enable_boot_diagnostics
storageUri = var.enable_boot_diagnostics ? format("https://%s.blob.core.windows.net", data.azurerm_storage_account.staging[0].name) : null
}
}
licenseType = local.virtual_machine_license
}
zones = [tostring(var.disk_profiles.disk_availability_zones.disk_primary_zone)]
})
schema_validation_enabled = false
tags = merge(local.tags, local.vmtags, local.provisioningtags)
}
No visible changes to whats being removed to whats being added.
Hi @mpjtaylor ,
Thank you for taking time to report this issue!
I'm not sure what the issue looks like? Is it saying the whole body is sensitive, so you couldn't see the detailed changes?
Disks removed and readded
Sorry for late response. It seems the lun
fields are changed?