I have written some terraform code for the recovery service vault. It does not create the vault in Canada East and US West.
It gives the following error code:
azurerm_recovery_services_vault.backup_vault: Still creating... [1m30s elapsed]
╷
│ Error: creating Vault (Subscription: "****"
│ Resource Group Name: "mydev-rg"
│ Vault Name: "mydev-vault"): backupresourcestorageconfigsnoncrr.BackupResourceStorageConfigsNonCRRClient#Update: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="UserErrorInvalidRequestParameter" Message="Parameter NO_PARAM in request is invalid. Please provide correct value for parameter NO_PARAM"
│
│ with azurerm_recovery_services_vault.backup_vault,
│ on main.tf line 22, in resource "azurerm_recovery_services_vault" "backup_vault":
│ 22: resource "azurerm_recovery_services_vault" "backup_vault" {
│
╵
Below is my full terraform code.
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.40.0"
}
}
}
provider "azurerm" {
features {}
subscription_id = var.subscription_id
}
resource "azurerm_resource_group" "backup_vault" {
name = "mydev-rg"
location = var.rg_location
}
# Create Azure Site Recovery Vault
resource "azurerm_recovery_services_vault" "backup_vault" {
name = "mydev-vault"
location = var.rg_location
resource_group_name = azurerm_resource_group.backup_vault.name
sku = "Standard"
soft_delete_enabled = true
public_network_access_enabled = false
storage_mode_type = "ZoneRedundant"
depends_on = [
azurerm_resource_group.backup_vault
]
}
#variables
variable "subscription_id" {
type = string
}
variable "rg_location" {
type = string
}
I managed to create the vault in different regions by equating var.rg_location with (eg. eastus, uksouth) except canadaeast and westus.