[英]Terraform - Using an ARM template to deploy Azure AD Domain Service (AADDS) using “azurerm_template_deployment”
我正在使用 Terraform azurerm_template_deployment
部署 AADDS,運行terraform apply
時出現以下錯誤
Error: Error validating Template for Deployment "aadds-arm-template" (Resource Group "RG-VNET-Aadds-001"): Deployment template validation failed: 'Template parameter JToken type is not valid. Expected 'Array'. Actual 'String'. Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
-----------------------------------
我使用下面的構造在我的 terraform 代碼中傳遞 theparams.parameters.json 和 aadds-arm-template.json 文件:
resource "azurerm_template_deployment" "aadds-arm-template" {
name = "aadds-arm-template"
resource_group_name = local.RG-Aadds-Name
template_body = file("aadds-arm-template.json")
parameters_body = file("theparams.parameters.json")
deployment_mode = "Incremental"
}
我相信 Terraform 這個 object 構造有問題:
"notificationSettings": {
"value": {
"notifyGlobalAdmins": "Disabled",
"notifyDcAdmins": "Enabled",
"additionalRecipients": []
}
},
這是在我的theparams.parameters.json
中。 如果有人會提供幫助將不勝感激。 我還在此鏈接中使用了相同的結構: Terraform - 將類型 Object 作為參數傳遞給 Azure 模板部署,但它從未起作用。
我不知道該怎么做,請幫助沒有意義我在過去的 2 天里一直在努力解決這個問題。
您的錯誤 output 告訴您出了什么問題...
'Template parameter JToken type is not valid. Expected 'Array'. Actual 'String'.
Please see https://aka.ms/resource-manager-parameter-files for usage details.'.
將該參數修復為數組。
我要感謝 Leif: https://stackoverflow.com/users/739351/leif不久前向其他人發布了這個答案,終於讓我的代碼使用他的文章中的解決方案在這里工作: Terraform - Passing鍵入 Object 作為 Azure 模板部署的參數。
好東西謝謝。 -平等
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.