У нас есть политика оповещения о мониторинге в GCP, которую мы настроили в Terraform. Мы также хотим создать документацию с помощью Terraform.
Мы создаем документацию, используя следующую команду в GCP.
gcloud alpha monitoring policies update projects/project_name/alertPolicies/5861347861929375791 \
--documentation-format="text/markdown" \
--documentation="API has exceeded its quota limit. The systems load has increased beyond capacity, consider increasing your Global and Regional quotas. If this is unexpected behaviour, validate that this is not a bug within your platform."
Есть ли способ создать то же самое в Terraform?
Конфигурация для политики мониторинга:
# Alerts when API seeing errors
resource "google_monitoring_alert_policy" "dlp_api_see_errors" {
project = PROJECT_NAME
display_name = "API is seeing errors"
combiner = "OR"
conditions {
display_name = "API is seeing errors"
condition_threshold {
filter = "metric.type=\"serviceruntime.googleapis.com/api/request_count\" resource.type=\"consumed_api\" metric.label.\"response_code\"!=\"200\" resource.label.\"service\"=\"dlp.googleapis.com\""
duration = "60s"
comparison = "COMPARISON_GT"
aggregations {
alignment_period = "60s"
per_series_aligner = "ALIGN_SUM"
cross_series_reducer = "REDUCE_SUM"
}
trigger {
count = 1
}
}
}
notification_channels = "${concat(google_monitoring_notification_channel.ndw_alerting_email.*.id, google_monitoring_notification_channel.ndw_alerting_phone.*.id)}"
}