Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple notification channels for each type #658

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/alerting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ No modules.
| <a name="input_failure_rate_exclude_services"></a> [failure\_rate\_exclude\_services](#input\_failure\_rate\_exclude\_services) | List of service names to exclude from the 5xx failure rate alert | `list(string)` | `[]` | no |
| <a name="input_failure_rate_ratio_threshold"></a> [failure\_rate\_ratio\_threshold](#input\_failure\_rate\_ratio\_threshold) | ratio threshold to alert for cloud run server failure rate. | `number` | `0.2` | no |
| <a name="input_global_only_alerts"></a> [global\_only\_alerts](#input\_global\_only\_alerts) | only enable global alerts. when true, only create alerts that are global. | `bool` | `false` | no |
| <a name="input_notification_channel_email"></a> [notification\_channel\_email](#input\_notification\_channel\_email) | Email notification channel. | `string` | `""` | no |
| <a name="input_notification_channel_pagerduty"></a> [notification\_channel\_pagerduty](#input\_notification\_channel\_pagerduty) | Email notification channel. | `string` | `""` | no |
| <a name="input_notification_channel_pubsub"></a> [notification\_channel\_pubsub](#input\_notification\_channel\_pubsub) | Pubsub notification channel. | `string` | `""` | no |
| <a name="input_notification_channel_slack"></a> [notification\_channel\_slack](#input\_notification\_channel\_slack) | Slack notification channel. | `string` | `""` | no |
| <a name="input_notification_channels"></a> [notification\_channels](#input\_notification\_channels) | List of notification channels to alert. | `list(string)` | `[]` | no |
| <a name="input_notification_channels_email"></a> [notification\_channels\_email](#input\_notification\_channels\_email) | Email notification channel. | `list(string)` | `[]` | no |
| <a name="input_notification_channels_pagerduty"></a> [notification\_channels\_pagerduty](#input\_notification\_channels\_pagerduty) | Email notification channel. | `list(string)` | `[]` | no |
| <a name="input_notification_channels_pubsub"></a> [notification\_channels\_pubsub](#input\_notification\_channels\_pubsub) | Pubsub notification channel. | `list(string)` | `[]` | no |
| <a name="input_notification_channels_slack"></a> [notification\_channels\_slack](#input\_notification\_channels\_slack) | Slack notification channel. | `list(string)` | `[]` | no |
| <a name="input_oom_filter"></a> [oom\_filter](#input\_oom\_filter) | additional filter to apply to oom alert policy | `string` | `""` | no |
| <a name="input_panic_filter"></a> [panic\_filter](#input\_panic\_filter) | additional filter to apply to panic alert policy | `string` | `""` | no |
| <a name="input_project_id"></a> [project\_id](#input\_project\_id) | n/a | `string` | n/a | yes |
Expand Down
22 changes: 11 additions & 11 deletions modules/alerting/main.tf
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
locals {
oncall = [
var.notification_channel_pagerduty,
var.notification_channel_email,
var.notification_channel_pubsub
]

slack = [
var.notification_channel_slack,
var.notification_channel_email,
var.notification_channel_pubsub
]
oncall = concat(
var.notification_channels_pagerduty,
var.notification_channels_email,
var.notification_channels_pubsub
)

slack = concat(
var.notification_channels_slack,
var.notification_channels_email,
var.notification_channels_pubsub
)
}

locals {
Expand Down
24 changes: 12 additions & 12 deletions modules/alerting/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ variable "notification_channels" {
default = []
}

variable "notification_channel_pagerduty" {
variable "notification_channels_pagerduty" {
description = "Email notification channel."
type = string
default = ""
type = list(string)
default = []
}

variable "notification_channel_slack" {
variable "notification_channels_slack" {
description = "Slack notification channel."
type = string
default = ""
type = list(string)
default = []
}

variable "notification_channel_email" {
variable "notification_channels_email" {
description = "Email notification channel."
type = string
default = ""
type = list(string)
default = []
}

variable "notification_channel_pubsub" {
variable "notification_channels_pubsub" {
description = "Pubsub notification channel."
type = string
default = ""
type = list(string)
default = []
}

variable "oom_filter" {
Expand Down
Loading