【问题标题】:Terraform - Provision VM Extensions with ParametersTerraform - 使用参数配置 VM 扩展
【发布时间】:2018-07-31 09:10:50
【问题描述】:

我正在尝试配置两个 Azure 虚拟机 Extensions,它们具有关联的参数:

  1. Microsoft 反恶意软件
  2. 用于 Windows 服务器监控的 Site24x7 代理

我找不到太多文档,但我尝试从 Automation script 下的 azure 门户中提取数据,以查看它是如何在 JSON 模板中设置的。

resource "azurerm_virtual_machine_extension" "test1" {
name                 = "IaaSAntimalware"
location             = "${azurerm_resource_group.test.location}"
resource_group_name  = "${azurerm_resource_group.test.name}"
virtual_machine_name = "${azurerm_virtual_machine.testapp.name}"
publisher            = "Microsoft.Azure.Security"
type                 = "IaaSAntimalware"
type_handler_version = "1.5.5.1"
auto_upgrade_minor_version = "true"

settings = <<SETTINGS
    {
        "AntimalwareEnabled": true,
        "RealtimeProtectionEnabled": "true",
        "ScheduledScanSettings": {
            "isEnabled": "true",
            "day": "1",
            "time": "120",
            "scanType": "Quick"
            },
        "Exclusions": {
            "Extensions": "",
            "Paths": "",
            "Processes": ""
            }
    }
SETTINGS

tags {
    environment = "${var.tag_env}" }
}

Azure Portal Configuration for Antimalware Extension

azurerm_virtual_machine_extension.test1:发生 1 个错误:`

azurerm_virtual_machine_extension.test1:compute.VirtualMachineExtensionsClient#CreateOrUpdate:发送请求失败:StatusCode=400 -- 原始错误:autorest/azure:服务返回错误。 Status=400 Code="InvalidParameter" Message="参数typeHandlerVersion的值无效。"

有人知道正确的语法吗?

【问题讨论】:

  • 我也在尝试使用 Site24x7 代理做同样的事情:` "settings": { ` "site24x7AgentType": "azurevmextnwindowsserver" }, "protectedSettings": { "site24x7LicenseKey": " } }跨度>

标签: azure azure-virtual-machine terraform terraform-provider-azure


【解决方案1】:

如果您查看 azure-quickstart-templates 的 anti-malware-extension-windows-vm 示例中的 this line"typeHandlerVersion": "1.1",,您会发现您传递了错误的版本值。

【讨论】:

    猜你喜欢
    • 2018-10-30
    • 2012-08-08
    • 2021-07-07
    • 1970-01-01
    • 2019-09-20
    • 2019-02-01
    • 2021-10-19
    • 1970-01-01
    • 2022-01-18
    相关资源
    最近更新 更多