From ea1eac93f6ff029459de3ec1c17714f0365b781a Mon Sep 17 00:00:00 2001 From: Clarissa Borges Date: Tue, 28 Jan 2025 13:40:07 -0300 Subject: [PATCH] Disable OpenSearch autotune by default (#21) This feature is only supported by some set of more expensive tiers, so if someone wants to use a tier that doesn't support auto-tune, they'll have to include additional configuration to the resource to support that instead of the other way around. By not enabling that feature by default, we'll only have it if someone intentionally wants to use it. --- modules/opensearch/main.tf | 2 +- modules/opensearch/variables.tf | 3 +-- opensearch.tf | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/opensearch/main.tf b/modules/opensearch/main.tf index 8f4d1b0..09052d5 100644 --- a/modules/opensearch/main.tf +++ b/modules/opensearch/main.tf @@ -67,7 +67,7 @@ resource "aws_opensearch_domain" "this" { for_each = length(var.auto_tune_options) > 0 ? [var.auto_tune_options] : [] content { - desired_state = try(auto_tune_options.value.desired_state, "ENABLED") + desired_state = try(auto_tune_options.value.desired_state, "DISABLED") dynamic "maintenance_schedule" { for_each = try(auto_tune_options.value.maintenance_schedule, []) diff --git a/modules/opensearch/variables.tf b/modules/opensearch/variables.tf index 0a018d7..9f32042 100644 --- a/modules/opensearch/variables.tf +++ b/modules/opensearch/variables.tf @@ -39,8 +39,7 @@ variable "auto_tune_options" { description = "Configuration block for the Auto-Tune options of the domain" type = any default = { - desired_state = "ENABLED" - rollback_on_disable = "NO_ROLLBACK" + desired_state = "DISABLED" } } diff --git a/opensearch.tf b/opensearch.tf index 04f34f5..d63b93c 100644 --- a/opensearch.tf +++ b/opensearch.tf @@ -36,7 +36,7 @@ module "opensearch" { } auto_tune_options = { - desired_state = "ENABLED" + desired_state = "DISABLED" maintenance_schedule = [ {