Я пытаюсь сопоставить сеть для восстановления сайта, но столкнулся со следующей проблемой.
Error: Error checking for presence of existing site recovery network mapping recovery-network-mapping (vault recovery-vault-360f): siterecovery.ReplicationNetworkMappingsClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="An invalid parameter NetworkMappingName was passed." Details=[{"activityId":"xxxxxxxxxxxxxxxxx","clientRequestId":"xxxxxxxxxxxxxxxxxxxxxxxxxxxxx","code":"InvalidParameter","message":"An invalid parameter NetworkMappingName was passed.","possibleCauses":"Parameter value is not correct for this action.","recommendedAction":"Correct the parameter value and retry the last action. If the issue persists, contact Support."}]
on modules/site_recovery/main.tf line 78, in resource "azurerm_site_recovery_network_mapping" "mapping":
78: resource "azurerm_site_recovery_network_mapping" "mapping" {
файл main.tf:
#Create Virtual Network in Primary Resource Group
resource "azurerm_virtual_network" "primary" {
name = var.virtual_network
resource_group_name = var.resource_group_name
location = var.location
address_space = var.address_space
depends_on = [var.resource_group_name]
tags = {
environment = "Test"
}
}
#Create Subnet in Virtual Network
resource "azurerm_subnet" "primary1" {
name = var.subnet1
virtual_network_name = azurerm_virtual_network.primary.name
resource_group_name = var.resource_group_name
address_prefix = var.address_prefix1
}
output "vnet_id1" {
value = "${azurerm_virtual_network.primary.id}"
}
Модуль восстановления сайта root файл main.tf : main.tf файл:
module "site_recovery" {
-----------
-----------
network_mapping = "recovery-network-mapping"
vnet_id1 = "${module.network.vnet_id1}"
-----------
-----------
}
Модуль восстановления сайта:
resource "azurerm_site_recovery_network_mapping" "mapping" {
name = var.network_mapping
resource_group_name = var.sec_resource_group
recovery_vault_name = azurerm_recovery_services_vault.vault.name
source_recovery_fabric_name = var.primary_fabric
target_recovery_fabric_name = var.seconday_fabric
source_network_id = var.vnet_id1
target_network_id = azurerm_virtual_network.secondary.id
depends_on = [var.vnet_id1, azurerm_virtual_network.secondary]
}
site_recovery variable.tf:
variable "vnet_id1" {
description = "The name of Primary VNET"
}
variable "network_mapping" {
description = "The name of Recovery Protection network_mapping"
}
Я получаю параметры имени сопоставления Неверно.