Skip to content

Commit

Permalink
azurerm_recovery_services_protected_vm: fix docs and mark backup_poli…
Browse files Browse the repository at this point in the history
…cy_id as required
  • Loading branch information
katbyte committed Oct 24, 2018
1 parent c5fcb1d commit bae31e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion azurerm/resource_arm_recovery_services_protected_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func resourceArmRecoveryServicesProtectedVm() *schema.Resource {

"backup_policy_id": {
Type: schema.TypeString,
Optional: true,
Required: true,
ForceNew: true,
ValidateFunc: azure.ValidateResourceID,
},
Expand Down
16 changes: 13 additions & 3 deletions website/docs/r/recovery_services_protected_vm.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}
```
Expand All @@ -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.

Expand Down

0 comments on commit bae31e9

Please sign in to comment.