FAQ | This is a LIVE service | Changelog

Commit 797e417a authored by Dmitrii Unterov's avatar Dmitrii Unterov
Browse files

feat!: deprecated variable alert_email_addresses removed

Now list of notification channels must be provided in alert_notification_channels variable.
parent c5d542de
Loading
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -52,9 +52,6 @@ module "monitoring" {
  # Optional. List of existing Notification Channels to be alerted.
  alert_notification_channels = ["projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]"]

  # Optional. List of email addresses to be alerted.
  alert_email_addresses = ["ops@example.com", "sla@example.com"]

  # Optional. Parameters to customise uptime checks.
  uptime_check = {
    # Enable alerting. Default: true.
+1 −3
Original line number Diff line number Diff line
@@ -57,9 +57,7 @@ locals {
  # Use the local.project value if var.monitoring_scoping_project is not provided.
  monitoring_scoping_project = coalesce(var.monitoring_scoping_project, local.project)

  notification_channels = concat([
    for channel in google_monitoring_notification_channel.email : channel.id
  ], var.alert_notification_channels)
  notification_channels = var.alert_notification_channels

  short_service_name = replace(substr(local.authentication_proxy.cloud_run_service_name, 0, 8), "/[-_\\s]+$/", "")
}
+0 −10
Original line number Diff line number Diff line
@@ -45,16 +45,6 @@ resource "google_monitoring_uptime_check_config" "https" {
  }
}

resource "google_monitoring_notification_channel" "email" {
  for_each = toset(var.alert_email_addresses)

  display_name = each.value
  type         = "email"
  labels = {
    email_address = each.value
  }
}

resource "google_monitoring_alert_policy" "uptime_alert" {
  project      = local.monitoring_scoping_project
  enabled      = local.uptime_check.alert_enabled
+0 −11
Original line number Diff line number Diff line
@@ -27,17 +27,6 @@ EOL
  default     = null
}

variable "alert_email_addresses" {
  type        = list(string)
  default     = []
  description = <<EOL
    DEPRECATED. An optional list of email addresses which should recieve alerts.
    This creates a separate Notification Channel for every email address in the list which is often not desired.
    Consider creating a Notification Channel separately and passing its ID to the alert_notification_channels
    variable instead.
EOL
}

variable "alert_notification_channels" {
  type        = list(string)
  default     = []