From e8f43f0010b57181a716aa4951b05aee7af2f9e3 Mon Sep 17 00:00:00 2001 From: Clarissa Borges Date: Mon, 10 Feb 2025 19:36:55 -0300 Subject: [PATCH] Control creation of dedicated master node for OpenSearch with variable And disable it by default. --- opensearch-variables.tf | 6 ++++++ opensearch.tf | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/opensearch-variables.tf b/opensearch-variables.tf index 1ad3f79..89b044f 100644 --- a/opensearch-variables.tf +++ b/opensearch-variables.tf @@ -10,6 +10,12 @@ variable "es_instance_count" { default = 2 } +variable "es_dedicated_master_enabled" { + type = bool + description = "Set to true to enable dedicated master nodes" + default = false +} + variable "es_dedicated_master_type" { type = string description = "Instance type of the dedicated main nodes in the cluster." diff --git a/opensearch.tf b/opensearch.tf index 3daa2dd..eb379fd 100644 --- a/opensearch.tf +++ b/opensearch.tf @@ -54,7 +54,7 @@ module "opensearch" { cluster_config = { instance_count = var.es_instance_count - dedicated_master_enabled = true + dedicated_master_enabled = var.es_dedicated_master_enabled dedicated_master_type = var.es_dedicated_master_type instance_type = coalesce(var.es_instance_type, var.es_dedicated_master_type)