【发布时间】:2020-01-10 09:12:42
【问题描述】:
我想使用 terraform 将现有添加的 google stackdriver 松弛通道添加到 stackdriver 警报模板中。警报策略已成功创建,但是当我尝试将松弛通道添加到同一模板时,无法使用松弛通道创建警报策略。它给出了错误。请根据适当的步骤提出建议。
resource "google_monitoring_notification_channel" "slack1" {
display_name = "#xxxx"
type = "slack"
labels = {
auth_token = "xxxxx"
channel_name = "#xxxxx"
}
}
resource "google_monitoring_notification_channel" "slack2" {
display_name = "#xxxx"
type = "slack"
labels = {
auth_token = "xxxxxxxxx"
channel_name = "#xxxx"
}
}
resource "google_monitoring_alert_policy" "alert_policy0" {
display_name = "xxxxxx"
combiner = "OR"
conditions {
display_name = "xxxxxxx"
condition_threshold {
filter = "xxxxxx""
duration = "300s"
comparison = "COMPARISON_GT"
threshold_value = 0.60
trigger {
count = 1
}
aggregations {
alignment_period = "60s"
per_series_aligner = "ALIGN_MEAN"
cross_series_reducer = "REDUCE_SUM"
}
}
}
documentation {
content = "xxxxxxx."
}
notification_channels = [
"${google_monitoring_notification_channel.slack.slack1.name}",
]
}
resource "google_monitoring_alert_policy" "alert_policy1" {
display_name = "xxxx"
combiner = "OR"
conditions {
display_name = "XXXXXX"
condition_threshold {
filter = "xxxxxxx""
duration = "60s"
comparison = "COMPARISON_GT"
threshold_value = 1024
trigger {
count = 1
}
aggregations {
alignment_period = "60s"
per_series_aligner = "ALIGN_MEAN"
cross_series_reducer = "REDUCE_SUM"
}
}
}
documentation {
content = "xxxx"
}
notification_channels = [
"${google_monitoring_notification_channel.slack.slack2.name}",
]
}
【问题讨论】:
-
请用您收到的确切错误更新此问题。
标签: google-cloud-platform terraform stackdriver google-cloud-stackdriver terraform-provider-gcp