Skip to content

Commit

Permalink
disable soft delete to pass test
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 25, 2024
1 parent fe5d48b commit 07ba189
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
21 changes: 11 additions & 10 deletions quickstart/101-backup-vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ resource "azurerm_resource_group" "rg" {
}

resource "random_string" "name" {
length = 12
lower = true
upper = false
numeric = false
special = false
length = 12
lower = true
upper = false
numeric = false
special = false
}

# Create virtual network
Expand Down Expand Up @@ -107,7 +107,7 @@ resource "azurerm_windows_virtual_machine" "main" {
resource_group_name = azurerm_resource_group.rg.name
network_interface_ids = [azurerm_network_interface.my_terraform_nic.id]
size = "Standard_DS1_v2"

os_disk {
name = "myOsDisk"
caching = "ReadWrite"
Expand Down Expand Up @@ -151,6 +151,7 @@ resource "azurerm_recovery_services_vault" "example" {
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = "Standard"
soft_delete_enabled = var.soft_delete_enabled
}

resource "azurerm_backup_policy_vm" "example" {
Expand All @@ -169,8 +170,8 @@ resource "azurerm_backup_policy_vm" "example" {
}

resource "azurerm_backup_protected_vm" "example" {
resource_group_name = azurerm_resource_group.rg.name
recovery_vault_name = azurerm_recovery_services_vault.example.name
source_vm_id = azurerm_windows_virtual_machine.main.id
backup_policy_id = azurerm_backup_policy_vm.example.id
resource_group_name = azurerm_resource_group.rg.name
recovery_vault_name = azurerm_recovery_services_vault.example.name
source_vm_id = azurerm_windows_virtual_machine.main.id
backup_policy_id = azurerm_backup_policy_vm.example.id
}
7 changes: 7 additions & 0 deletions quickstart/101-backup-vm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ variable "resource_group_name_prefix" {
type = string
default = "rg"
description = "Prefix of the resource group name that's combined with a random ID so name is unique in your Azure subscription."
}

variable "soft_delete_enabled" {
type = bool
default = false
nullable = false
description = "Is soft delete enable for the recovery services vault?"
}

0 comments on commit 07ba189

Please sign in to comment.