Skip to content

Commit b41f5bf

Browse files
refs platform/board#4082: remove module dependencies
1 parent 5cb5571 commit b41f5bf

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

cert_manager.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ locals {
99
)
1010
cert_manager_notification_channels = var.cert_manager.notification_enabled ? (length(var.cert_manager.notification_channels) > 0 ? var.cert_manager.notification_channels : var.notification_channels) : []
1111

12-
cert_manager_log_filter = <<-EOT
12+
cert_manager_log_filter = var.cert_manager.cluster_name != null ? (<<-EOT
1313
(
1414
(
1515
resource.type="k8s_container"
@@ -34,6 +34,7 @@ locals {
3434
)
3535
${trimspace(var.cert_manager.filter_extra)}
3636
EOT
37+
) : ""
3738
}
3839

3940
resource "google_monitoring_alert_policy" "cert_manager_logmatch_alert" {

kyverno.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ locals {
33
alert_documentation = var.kyverno.alert_documentation != null ? var.kyverno.alert_documentation : "Kyverno controllers produced ERROR logs in namespace ${var.kyverno.namespace}."
44
kyverno_notification_channels = var.kyverno.notification_enabled ? (length(var.kyverno.notification_channels) > 0 ? var.kyverno.notification_channels : var.notification_channels) : []
55

6-
kyverno_log_filter = <<-EOT
6+
kyverno_log_filter = var.kyverno.cluster_name != null ? (<<-EOT
77
resource.type="k8s_container"
88
AND resource.labels.project_id="${local.kyverno_project_id}"
99
AND resource.labels.cluster_name="${var.kyverno.cluster_name}"
@@ -48,6 +48,7 @@ locals {
4848
)
4949
${trimspace(var.kyverno.filter_extra)}
5050
EOT
51+
) : ""
5152
}
5253

5354
resource "google_monitoring_alert_policy" "kyverno_logmatch_alert" {

variables.tf

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ variable "notification_channels" {
1111

1212
variable "cloud_sql" {
1313
description = "Configuration for Cloud SQL monitoring alerts. Supports customization of project, auto-close timing, notification channels, and per-instance alert thresholds for CPU, memory, and disk utilization."
14+
default = {}
1415
type = object({
16+
enabled = optional(bool, true)
1517
project_id = optional(string, null)
1618
auto_close = optional(string, "86400s") # default 24h
1719
notification_enabled = optional(bool, true)
@@ -68,9 +70,10 @@ variable "cloud_sql" {
6870

6971
variable "kyverno" {
7072
description = "Configuration for Kyverno monitoring alerts. Allows customization of cluster name, project, notification channels, alert documentation, metric thresholds, auto-close timing, enablement, extra filters, and namespace."
73+
default = {}
7174
type = object({
72-
enabled = optional(bool, true)
73-
cluster_name = string
75+
enabled = optional(bool, false)
76+
cluster_name = optional(string, null)
7477
project_id = optional(string, null)
7578
notification_enabled = optional(bool, true)
7679
notification_channels = optional(list(string), [])
@@ -85,9 +88,10 @@ variable "kyverno" {
8588

8689
variable "cert_manager" {
8790
description = "Configuration for cert-manager missing issuer log alert. Allows customization of project, cluster, namespace, notification channels, alert documentation, enablement, extra filters, auto-close timing, and notification rate limiting."
91+
default = {}
8892
type = object({
89-
enabled = optional(bool, true)
90-
cluster_name = string
93+
enabled = optional(bool, false)
94+
cluster_name = optional(string, null)
9195
project_id = optional(string, null)
9296
namespace = optional(string, "cert-manager")
9397
notification_enabled = optional(bool, true)
@@ -101,8 +105,9 @@ variable "cert_manager" {
101105

102106
variable "konnectivity_agent" {
103107
description = "Configuration for Konnectivity agent deployment replica alert in GKE. Triggers when there are no available replicas."
108+
default = {}
104109
type = object({
105-
enabled = optional(bool, true)
110+
enabled = optional(bool, false)
106111
cluster_name = optional(string, null)
107112
project_id = optional(string, null)
108113
namespace = optional(string, "kube-system")

0 commit comments

Comments
 (0)