From d224404424453f1183afe28061199bafb9d61b23 Mon Sep 17 00:00:00 2001 From: Abhishek Patil Date: Wed, 29 Jun 2022 14:54:05 +0530 Subject: [PATCH] when using managed prometheus or passing monitoring config there is error thrown as Error: googleapi: Error 400: Cannot specify logging_config or monitoring_config together with logging_service or monitoring_service., badRequest which is resolved using the fix --- modules/gke-cluster/main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf index da32ec3722..095ee5a97f 100644 --- a/modules/gke-cluster/main.tf +++ b/modules/gke-cluster/main.tf @@ -39,7 +39,7 @@ resource "google_container_cluster" "cluster" { min_master_version = var.min_master_version network = var.network subnetwork = var.subnetwork - logging_service = var.logging_config == null ? var.logging_service : null + logging_service = var.monitoring_config != null ? null : var.logging_config == null ? var.logging_service : null monitoring_service = var.monitoring_config == null ? var.monitoring_service : null resource_labels = var.labels default_max_pods_per_node = var.enable_autopilot ? null : var.default_max_pods_per_node