refactor(terraform): Directory structure
[csit.git] / fdio.infra.terraform / terraform-nomad-loki / variables.tf
@@ -1,5 +1,4 @@
 # Nomad
-
 variable "datacenters" {
   description = "Specifies the list of DCs to be considered placing this task"
   type        = list(string)
@@ -15,14 +14,14 @@ variable "region" {
 variable "volume_source" {
   description = "The name of the volume to request"
   type        = string
-  default     = "persistence"
+  default     = ""
 }
 
-# Minio
-variable "access_key" {
-  description = "Minio access key"
+# Grafana Loki
+variable "gl_version" {
+  description = "Grafana Loki version"
   type        = string
-  default     = "minio"
+  default     = "2.4.2"
 }
 
 variable "auto_promote" {
@@ -44,15 +43,15 @@ variable "canary" {
 }
 
 variable "cpu" {
-  description = "Specifies the CPU required to run this task in MHz"
+  description = "CPU allocation"
   type        = number
-  default     = 1000
+  default     = 2000
 }
 
-variable "envs" {
-  description = "Minio environment variables"
-  type        = list(string)
-  default     = []
+variable "data_dir" {
+  description = "Loki data dir allocation"
+  type        = string
+  default     = ""
 }
 
 variable "group_count" {
@@ -61,38 +60,10 @@ variable "group_count" {
   default     = 1
 }
 
-variable "host" {
-  description = "Minio host"
-  type        = string
-  default     = "127.0.0.1"
-}
-
-variable "image" {
-  description = "The Docker image to run"
-  type        = string
-  default     = "minio/minio:latest"
-}
-
 variable "job_name" {
   description = "Specifies a name for the job"
   type        = string
-  default     = "minio"
-}
-
-variable "kms_variables" {
-  type = object({
-    use_vault_kms        = string
-    vault_address        = string,
-    vault_kms_approle_kv = string,
-    vault_kms_key_name   = string
-  })
-  description = "Set of properties to be able to transit secrets in vault"
-  default = {
-    use_vault_kms        = false
-    vault_address        = "",
-    vault_kms_approle_kv = "",
-    vault_kms_key_name   = ""
-  }
+  default     = "loki"
 }
 
 variable "max_parallel" {
@@ -104,68 +75,25 @@ variable "max_parallel" {
 variable "memory" {
   description = "Specifies the memory required in MB"
   type        = number
-  default     = 1024
-}
-
-variable "mode" {
-  description = "Specifies the Minio mode"
-  type        = string
-  default     = "server"
+  default     = 4096
 }
 
-variable "port_base" {
+variable "port" {
   description = "Specifies the static TCP/UDP port to allocate"
   type        = number
-  default     = 9000
-}
-
-variable "port_console" {
-  description = "Specifies the static TCP/UDP port to allocate"
-  type        = number
-  default     = 9001
-}
-
-variable "resource_proxy" {
-  description = "Minio proxy resources"
-  type = object({
-    cpu    = number,
-    memory = number
-  })
-  default = {
-    cpu    = 2000,
-    memory = 1024
-  }
-  validation {
-    condition     = var.resource_proxy.cpu >= 200 && var.resource_proxy.memory >= 128
-    error_message = "Proxy resource must be at least: cpu=200, memory=128."
-  }
+  default     = 3100
 }
 
 variable "service_name" {
   description = "Specifies the name this service will be advertised in Consul"
   type        = string
-  default     = "minio"
-}
-
-variable "secret_key" {
-  description = "Minio secret key"
-  type        = string
-  default     = "minio"
-}
-
-variable "upstreams" {
-  type = list(object({
-    service_name = string,
-    port         = number,
-  }))
-  description = "List of upstream services"
-  default     = []
+  default     = "loki"
 }
 
 variable "use_canary" {
-  description = "Uses canary deployment for Minio"
+  description = "Uses canary deployment"
   type        = bool
-  default     = false
+  default     = true
 }
 
 variable "use_host_volume" {
@@ -174,6 +102,12 @@ variable "use_host_volume" {
   default     = false
 }
 
+variable "volume_destination" {
+  description = "Specifies where the volume should be mounted inside the task"
+  type        = string
+  default     = ""
+}
+
 variable "vault_secret" {
   type = object({
     use_vault_provider        = bool,
@@ -182,18 +116,12 @@ variable "vault_secret" {
     vault_kv_field_access_key = string,
     vault_kv_field_secret_key = string
   })
-  description = "Set of properties to be able to fetch secret from vault"
+  description = "Set of properties to be able to fetch secret from vault."
   default = {
     use_vault_provider        = false
     vault_kv_policy_name      = "kv"
-    vault_kv_path             = "secret/data/minio"
+    vault_kv_path             = "secret/data/prometheus"
     vault_kv_field_access_key = "access_key"
     vault_kv_field_secret_key = "secret_key"
   }
 }
-
-variable "volume_destination" {
-  description = "Specifies where the volume should be mounted inside the task"
-  type        = string
-  default     = "/data/"
-}