【发布时间】:2021-08-27 17:30:58
【问题描述】:
我正在尝试使用 terraform 使用 local-exec 配置程序运行一些 az cli 命令,但我一直遇到以下错误:
Error: Invalid expression
On modules/eventgrid/main.tf line 68: Expected the start of an expression, but
found an invalid expression token.
这是我的代码:
resource "null_resource" "eg-role-assignment" {
provisioner "local-exec" {
interpreter = ["/bin/bash", "-c"]
command = <<EOT
"az account set --subscription foo"
"az eventgrid topic update --resource-group $RESOURCE_GROUP --name $EVENTGRID_NAME --identity systemassigned"
EOT
environment = {
RESOURCE_GROUP = "RG_${var.platform_tag}_${var.product_code}_PUBLISH_${var.environment}_${var.location_code_primary}"
EVENTGRID_NAME = "EG-${var.platform_tag}-${var.product_code}-${var.environment}-${var.location_code_primary}-domain"
}
}
}
谁能指导我怎么回事?
【问题讨论】:
标签: terraform azure-cli terraform-provider-azure