json - Terraform - 使用 ARM 模板通过“azurerm_template_deployment”部署 Azure AD 域服务 (AADDS)
问题描述
我正在使用 Terraformazurerm_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 对这个对象构造有问题:
"notificationSettings": {
"value": {
"notifyGlobalAdmins": "Disabled",
"notifyDcAdmins": "Enabled",
"additionalRecipients": []
}
},
在我的theparams.parameters.json
文件中,我没有发布这两个文件的内容,因为我确信这是引起所有大惊小怪的对象的传递。如果有人会提供帮助将不胜感激。我还在此链接中使用了相同的构造:Terraform - 将类型对象作为参数传递给 Azure 模板部署,但它从未奏效。
我不知道该怎么做,请帮助没有意义我在过去的 2 天里一直在努力解决这个问题。
解决方案
我要感谢 Leif:https ://stackoverflow.com/users/739351/leif ,他不久前将这个答案发布给了其他人,并最终让我的代码使用他的文章中的解决方案工作:Terraform - Passing键入 Object 作为 Azure 模板部署的参数。
好东西谢谢。-平等
推荐阅读
- c++ - 如何比较 C++ 中的字符串以便按字典顺序对它们进行排序?
- python - 将字符串拆分为两个整数,python
- csv - Jira Xray 将测试步骤添加到现有测试通过。csv 上传
- javascript - 如何在flutter项目的web文件夹中的js文件中正确使用env变量
- python - Pydrive:获取有关共享文件的详细信息
- css - 如何使用 css 模块重新定义样式?
- windows - 无法在 Windows 服务中启动 Redis。错误 1067:进程意外终止
- python - 是否可以在 requirements.txt 文件中指定不同的 Python 包索引?
- python - 如何将 matplotlib 中的图形保存在特定文件夹中(spyder)
- python - 根据列中首先出现的字符串/类别,保留该行并删除 pandas 中的其他行