Skip to content

Commit 87a3334

Browse files
committed
Enable GKE Auto-Monitoring
1 parent ab18811 commit 87a3334

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

platforms/gke/base/_shared_config/cluster_variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,23 @@ locals {
4343
kubeconfig_file_name = "${var.cluster_project_id}-${local.cluster_name}"
4444
}
4545

46+
variable "cluster_auto_monitoring_config_scope" {
47+
default = "ALL"
48+
description = "Whether or not to enable GKE Auto-Monitoring. Supported values include: ALL, NONE"
49+
type = string
50+
51+
validation {
52+
condition = contains(
53+
[
54+
"ALL",
55+
"NONE",
56+
],
57+
var.cluster_auto_monitoring_config_scope
58+
)
59+
error_message = "'cluster_auto_monitoring_config_scope' value is invalid"
60+
}
61+
}
62+
4663
variable "cluster_binary_authorization_evaluation_mode" {
4764
default = "DISABLED"
4865
description = "Mode of operation for Binary Authorization policy evaluation. Valid values are DISABLED and PROJECT_SINGLETON_POLICY_ENFORCE."

platforms/gke/base/core/container_cluster/container_cluster.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ resource "google_container_cluster" "cluster" {
166166

167167
managed_prometheus {
168168
enabled = true
169+
170+
auto_monitoring_config {
171+
scope = var.cluster_auto_monitoring_config_scope
172+
}
169173
}
170174
}
171175

0 commit comments

Comments
 (0)