FAQ | This is a LIVE service | Changelog

Skip to content
Snippets Groups Projects
Commit 5a3cfb2b authored by Ryan Kowalewski's avatar Ryan Kowalewski :man_dancing:
Browse files

Merge branch 'notification-channels-instead-of-emails' into 'master'

feat: add alert_notification_channels variable

See merge request !8
parents 6a5802d3 69de5b5e
No related branches found
Tags 2.3.0
1 merge request!8feat: add alert_notification_channels variable
Pipeline #451273 passed
......@@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.3.0] - 2024-01-03
### Added
* Variable `alert_notification_channels` added, the old `alert_email_addresses` one
is now deprecated
## [2.2.1] - 2023-11-02
### Added
......
......@@ -16,6 +16,10 @@ locals {
# A kebab-case name in case we're given underscore_case.
kebab_name = replace(var.name, "_", "-")
notification_channels = concat([
for channel in google_monitoring_notification_channel.email : channel.id
], var.alert_notification_channels)
}
# The source code of the script.
......@@ -198,10 +202,7 @@ resource "google_monitoring_alert_policy" "successes" {
enabled = var.alert_enabled
notification_channels = [
for address in var.alert_email_addresses :
google_monitoring_notification_channel.email[address].name
]
notification_channels = local.notification_channels
combiner = "OR"
......
......@@ -103,10 +103,25 @@ variable "available_memory_mb" {
variable "alert_email_addresses" {
type = list(string)
default = []
description = <<-EOT
List of email addresses which should be notified if invocations of the
script start to fail.
EOT
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 = []
description = <<EOL
A list of notification channel IDs to send alerts to. The format for the channel IDs should
be as follows.
[
"projects/[PROJECT_ID]/notificationChannels/[CHANNEL_ID]"
]
EOL
}
variable "alert_success_threshold" {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment