diff --git a/README.adoc b/README.adoc index 96f5f39f..8f4ebf77 100644 --- a/README.adoc +++ b/README.adoc @@ -139,6 +139,14 @@ Type: `bool` Default: `false` +==== [[input_retention]] <> + +Description: Logs retention period.To deactivate retention, pass 0s. + +Type: `string` + +Default: `"30d"` + === Outputs The following outputs are exported: @@ -172,8 +180,8 @@ Description: n/a |[[provider_null]] <> |>= 3 |[[provider_random]] <> |>= 3 |[[provider_htpasswd]] <> |>= 1 -|[[provider_argocd]] <> |>= 4 |[[provider_utils]] <> |>= 1 +|[[provider_argocd]] <> |>= 4 |=== = Resources @@ -279,6 +287,12 @@ object({ |`false` |no +|[[input_retention]] <> +|Logs retention period.To deactivate retention, pass 0s. +|`string` +|`"30d"` +|no + |=== = Outputs diff --git a/aks/README.adoc b/aks/README.adoc index da5ce440..a62e2064 100644 --- a/aks/README.adoc +++ b/aks/README.adoc @@ -159,6 +159,14 @@ Type: `bool` Default: `false` +==== [[input_retention]] <> + +Description: Logs retention period.To deactivate retention, pass 0s. + +Type: `string` + +Default: `"30d"` + === Outputs The following outputs are exported: @@ -319,6 +327,12 @@ object({ |`false` |no +|[[input_retention]] <> +|Logs retention period.To deactivate retention, pass 0s. +|`string` +|`"30d"` +|no + |=== = Outputs diff --git a/aks/main.tf b/aks/main.tf index 32a5e6f4..4e6deecd 100644 --- a/aks/main.tf +++ b/aks/main.tf @@ -47,6 +47,7 @@ module "loki-stack" { app_autosync = var.app_autosync dependency_ids = var.dependency_ids + retention = var.retention distributed_mode = var.distributed_mode ingress = var.ingress enable_filebeat = var.enable_filebeat diff --git a/eks/README.adoc b/eks/README.adoc index 5d28e913..bc11178e 100644 --- a/eks/README.adoc +++ b/eks/README.adoc @@ -141,6 +141,14 @@ Type: `bool` Default: `false` +==== [[input_retention]] <> + +Description: Logs retention period.To deactivate retention, pass 0s. + +Type: `string` + +Default: `"30d"` + === Outputs The following outputs are exported: @@ -279,6 +287,12 @@ object({ |`false` |no +|[[input_retention]] <> +|Logs retention period.To deactivate retention, pass 0s. +|`string` +|`"30d"` +|no + |=== = Outputs diff --git a/eks/main.tf b/eks/main.tf index d0990f8d..a98de3cf 100644 --- a/eks/main.tf +++ b/eks/main.tf @@ -7,6 +7,7 @@ module "loki-stack" { app_autosync = var.app_autosync dependency_ids = var.dependency_ids + retention = var.retention distributed_mode = var.distributed_mode ingress = var.ingress enable_filebeat = var.enable_filebeat diff --git a/kind/README.adoc b/kind/README.adoc index fad33662..59136cab 100644 --- a/kind/README.adoc +++ b/kind/README.adoc @@ -142,6 +142,14 @@ Type: `bool` Default: `false` +==== [[input_retention]] <> + +Description: Logs retention period.To deactivate retention, pass 0s. + +Type: `string` + +Default: `"30d"` + === Outputs The following outputs are exported: @@ -281,6 +289,12 @@ object({ |`false` |no +|[[input_retention]] <> +|Logs retention period.To deactivate retention, pass 0s. +|`string` +|`"30d"` +|no + |=== = Outputs diff --git a/kind/main.tf b/kind/main.tf index d0990f8d..a98de3cf 100644 --- a/kind/main.tf +++ b/kind/main.tf @@ -7,6 +7,7 @@ module "loki-stack" { app_autosync = var.app_autosync dependency_ids = var.dependency_ids + retention = var.retention distributed_mode = var.distributed_mode ingress = var.ingress enable_filebeat = var.enable_filebeat diff --git a/locals.tf b/locals.tf index ff90246f..5abc3380 100644 --- a/locals.tf +++ b/locals.tf @@ -67,8 +67,7 @@ locals { } } compactor = { - retention_delete_delay = "1h" - retention_enabled = false + retention_enabled = true } ingester = { lifecycler = { @@ -85,10 +84,10 @@ locals { ingestion_rate_mb = 10 max_chunks_per_query = 0 max_entries_limit_per_query = 0 - max_query_length = "9000h" + max_query_length = var.retention max_query_parallelism = 6 per_stream_rate_limit = "10MB" - retention_period = "9000h" + retention_period = var.retention } querier = { max_concurrent = 2 diff --git a/variables.tf b/variables.tf index 9ae83ede..eaaca6ed 100644 --- a/variables.tf +++ b/variables.tf @@ -71,3 +71,14 @@ variable "enable_filebeat" { type = bool default = false } + +variable "retention" { + description = "Logs retention period.To deactivate retention, pass 0s." + type = string + default = "30d" + + validation { + condition = var.retention != null + error_message = "Variable must not be null." + } +}