diff --git a/azurerm/resource_arm_managed_disk.go b/azurerm/resource_arm_managed_disk.go index b2997cc09f9c..38b3954cbfa6 100644 --- a/azurerm/resource_arm_managed_disk.go +++ b/azurerm/resource_arm_managed_disk.go @@ -60,6 +60,7 @@ func resourceArmManagedDisk() *schema.Resource { string(compute.Empty), string(compute.FromImage), string(compute.Import), + string(compute.Restore), }, true), }, @@ -183,7 +184,7 @@ func resourceArmManagedDiskCreateUpdate(d *schema.ResourceData, meta interface{} } else { return fmt.Errorf("[ERROR] source_uri must be specified when create_option is `%s`", compute.Import) } - } else if strings.EqualFold(createOption, string(compute.Copy)) { + } else if strings.EqualFold(createOption, string(compute.Copy)) || strings.EqualFold(createOption, string(compute.Restore)) { if sourceResourceId := d.Get("source_resource_id").(string); sourceResourceId != "" { createDisk.CreationData.SourceResourceID = &sourceResourceId } else { diff --git a/website/docs/r/managed_disk.html.markdown b/website/docs/r/managed_disk.html.markdown index 9b235d3b260f..0dcdea820802 100644 --- a/website/docs/r/managed_disk.html.markdown +++ b/website/docs/r/managed_disk.html.markdown @@ -89,10 +89,12 @@ The following arguments are supported: * `Empty` - Create an empty managed disk. * `Copy` - Copy an existing managed disk or snapshot (specified with `source_resource_id`). * `FromImage` - Copy a Platform Image (specified with `image_reference_id`) + * `Restore` - Set by Azure Backup or Site Recovery on a restored disk (specified with `source_resource_id`). * `source_uri` - (Optional) URI to a valid VHD file to be used when `create_option` is `Import`. -* `source_resource_id` - (Optional) ID of an existing managed disk to copy when `create_option` is `Copy`. +* `source_resource_id` - (Optional) ID of an existing managed disk to copy `create_option` is `Copy` + or the recovery point to restore when `create_option` is `Restore` * `image_reference_id` - (Optional) ID of an existing platform/marketplace disk image to copy when `create_option` is `FromImage`.