From bae31e93cb7859a3662abcd580df7713dbef3f2f Mon Sep 17 00:00:00 2001 From: kt Date: Wed, 24 Oct 2018 15:55:27 -0700 Subject: [PATCH] azurerm_recovery_services_protected_vm: fix docs and mark backup_policy_id as required --- ...esource_arm_recovery_services_protected_vm.go | 2 +- .../r/recovery_services_protected_vm.markdown | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/azurerm/resource_arm_recovery_services_protected_vm.go b/azurerm/resource_arm_recovery_services_protected_vm.go index 47ec96ab491d..fc6976141660 100644 --- a/azurerm/resource_arm_recovery_services_protected_vm.go +++ b/azurerm/resource_arm_recovery_services_protected_vm.go @@ -51,7 +51,7 @@ func resourceArmRecoveryServicesProtectedVm() *schema.Resource { "backup_policy_id": { Type: schema.TypeString, - Optional: true, + Required: true, ForceNew: true, ValidateFunc: azure.ValidateResourceID, }, diff --git a/website/docs/r/recovery_services_protected_vm.markdown b/website/docs/r/recovery_services_protected_vm.markdown index 65a14d97f055..2fd7ad8ed601 100644 --- a/website/docs/r/recovery_services_protected_vm.markdown +++ b/website/docs/r/recovery_services_protected_vm.markdown @@ -26,13 +26,23 @@ resource "azurerm_recovery_services_vault" "example" { sku = "Standard" } +resource "azurerm_recovery_services_protection_policy_vm" "test" { + name = "acctest-%d" + resource_group_name = "${azurerm_resource_group.test.name}" + recovery_vault_name = "${azurerm_recovery_services_vault.test.name}" + + backup = { + frequency = "Daily" + time = "23:00" + } +} + resource "azurerm_recovery_services_protected_vm" "example" { location = "${azurerm_resource_group.example.location}" resource_group_name = "${azurerm_resource_group.example.name}" recovery_vault_name = "${azurerm_recovery_services_vault.example.name}" - source_vm_name = "${azurerm_virtual_machine.example.name}" source_vm_id = "${azurerm_virtual_machine.example.id}" - backup_policy_name = "aBackupPolicy" + backup_policy_id = "${azurerm_recovery_services_protection_policy_vm.example.id}" } ``` @@ -51,7 +61,7 @@ The following arguments are supported: * `source_vm_id` - (Required) Specifies the ID of the VM to backup. Changing this forces a new resource to be created. -* `backup_policy_name` - (Optional) Specifies the name of the backup policy to use. Defaults to `DefaultPolicy` Changing this forces a new resource to be created. +* `backup_policy_id` - (Required) Specifies the id of the backup policy to use. Changing this forces a new resource to be created. * `tags` - (Optional) A mapping of tags to assign to the resource.