![](/img/trans.png)
[英]Terraform on GCP fails to create pubsub topic stating permission denied
[英]gcp terraform - how to add pubsub_topic
我對 GCP 和 terraform 很陌生。 我正在嘗試在 Google Cloud 中使用 terraform 創建 pubsub_topic 並將其與預算鏈接,因此預算將使用該主題作為與雲 function 的鏈接(傳遞通知)。
我被困在創建主題上。
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
pubsub_topic 必填引號
all_updates_rule {
pubsub_topic = "projects/my_project/topics/alert_topic"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.