【发布时间】:2020-07-28 10:38:46
【问题描述】:
我对 GCP 和 terraform 还很陌生。 我正在尝试在 Google Cloud 中使用 terraform 创建 pubsub_topic 并将其与预算链接,因此预算将使用该主题作为与云功能的链接(传递通知)。
我一直在创建主题。
resource "google_pubsub_topic" "topic" {
name = alert_topic
project = my_project
}
resource "google_billing_budget" "global-budget" {
provider = google-beta
billing_account = var.billing_account_id
display_name = "Global Billing Budget"
amount {
specified_amount {
currency_code = "EUR"
units = "500"
}
}
threshold_rules {
threshold_percent = 0.5
}
all_updates_rule {
pubsub_topic = projects / my_project / topics / alert_topic
}
}
terraform plan 命令结果:
A reference to a resource type must be followed by at least one
attribute access, specifying the resource name.
我做错了什么?
terraform version
Terraform v0.12.23
+ provider.google v3.13.0
+ provider.google-beta v3.13.0
【问题讨论】:
-
完整的错误显示什么?您似乎已经删除了错误周围的一些上下文。
-
我在资源上添加了引号......所以问题消失了。傻。
标签: google-cloud-platform terraform google-cloud-pubsub