Terraform -导入可用性测试



我想从azure门户导入可用性测试

根据文档https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/monitor_metric_alert,它说使用terraform import azurerm_monitor_metric_alert.main /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/example-resources/providers/Microsoft.Insights/metricAlerts/example-metricalert

我使用的命令是terraform import azurerm_monitor_metric_alert.this /subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Insights/metricAlerts/example metric alert test-appinsightsname

我的问题是,我的可用性名称有点不同:示例度量警报test-app-insights

这是我得到的错误导入命令需要两个参数

经过几次尝试,我发现解决方案是添加">当可用性名称有多个名称

解决方案:

terraform import azurerm_monitor_metric_alert.this "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.Insights/metricAlerts/example metric alert test-appinsightsname"

最新更新