Skip to content

azurerm_backup_policy_vm: duration_type in archived_restore_point is ignored/nonexistant, always shown as Months in Azure Portal#33217

Description

@Alxtp

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

v1.15.9

AzureRM Provider Version

v5.2.0

Affected Resource(s)/Data Source(s)

azurerm_backup_policy_vm

Affected Location(s)

switzerlandnorth

Terraform Configuration Files

resource "azurerm_resource_group" "example" {
  name     = "tfex-recovery_vault"
  location = "switzerlandnorth"
}

resource "azurerm_recovery_services_vault" "example" {
  name                = "tfex-recovery-vault"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
  sku                 = "Standard"
}

resource "azurerm_backup_policy_vm" "example" {
  name                = "tfex-recovery-vault-policy"
  resource_group_name = azurerm_resource_group.example.name
  recovery_vault_name = azurerm_recovery_services_vault.example.name

  timezone = "UTC"

  backup {
    frequency = "Daily"
    time      = "23:00"
  }

  retention_yearly {
    count    = 77
    weekdays = ["Sunday"]
    weeks    = ["Last"]
    months   = ["January"]
  }

  tiering_policy {
    archived_restore_point {
      mode          = "TierAfter"
      duration      = 90
      duration_type = "Days"
    }
  }
}

Debug Output/Panic Output

Runs successfully

Expected Behaviour

Setting duration_type = "Days" with duration = 90 should configure the tiering policy to move recovery points to archive tier after 90 days. If it's not supported by the API, it should throw a error.

Actual Behaviour

Regardless of the duration_type configured (Days, Weeks, Months, Years), the Azure Portal always displays and applies the value as Months. With duration = 90, this results in the portal showing "90 Months" and throwing a validation error:
Image

Steps to Reproduce

  1. Create an azurerm_backup_policy_vm resource with a tiering_policy block using duration_type = "Days" and duration = 90.
  2. Run terraform apply

Important Factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions